From 8e0cf67fdab51f72c2756200a4f52a762b970223 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 10 May 2024 14:57:50 +0800 Subject: [PATCH] RT:add kernel-rt-6.6.0-25.0.0.rt20.1 --- kernel-rt.spec | 10612 +++++++++++ patch-6.6.0-6.0.0-rt20.patch | 15642 ++++++++++++++++ ...6.0.0-rt20.patch-openeuler_defconfig.patch | 71 + 3 files changed, 26325 insertions(+) create mode 100644 kernel-rt.spec create mode 100644 patch-6.6.0-6.0.0-rt20.patch create mode 100644 patch-6.6.0-6.0.0-rt20.patch-openeuler_defconfig.patch diff --git a/kernel-rt.spec b/kernel-rt.spec new file mode 100644 index 0000000..4d314d2 --- /dev/null +++ b/kernel-rt.spec @@ -0,0 +1,10612 @@ +%define with_signmodules 1 +%define with_kabichk 0 + +# Default without toolchain_clang +%bcond_with toolchain_clang + +%if %{with toolchain_clang} +%global toolchain clang +%endif + +%bcond_with clang_lto + +%if %{with clang_lto} && "%{toolchain}" != "clang" +{error:clang_lto requires --with toolchain_clang} +%endif + +%define modsign_cmd %{SOURCE10} + +%if 0%{?openEuler_sign_rsa} +# Use the open-source signature when the EBS permission is insufficient. +# Now only the admin user in EBS can send the signature request. But the +# user triggering the acces control build task and the personal build +# task is non-admin. Inorder to avoid build failures caused by failed +# signing, use the open-source signature. +# The flag_openEuler_has_sign_perm used in the rpm execution phase +# The openEuler_has_sign_perm used in the rpm execution phase + +%define openEuler_check_EBS_perm openEuler_has_sign_perm=0 \ +echo "" >> test_openEuler_sign.ko \ +sh /usr/lib/rpm/brp-ebs-sign --module test_openEuler_sign.ko || \ +[ $? -ne 2 ] && openEuler_has_sign_perm=1 \ +%global flag_openEuler_has_sign_perm $openEuler_has_sign_perm \ +rm -f test_openEuler_sign.ko test_openEuler_sign.ko.sig +%endif + +%global Arch $(echo %{_host_cpu} | sed -e s/i.86/x86/ -e s/x86_64/x86/ -e s/aarch64.*/arm64/ -e s/riscv.*/riscv/ -e s/powerpc64le/powerpc/ -e s/loongarch64/loongarch/) + +%global KernelVer %{version}-%{release}.%{_target_cpu} +%global debuginfodir /usr/lib/debug + +%global upstream_version 6.6 +%global upstream_sublevel 0 +%global devel_release 25 +%global maintenance_release .0.0 +%global pkg_release .1 +%global rt_release .rt20 + +%define with_debuginfo 1 +# Do not recompute the build-id of vmlinux in find-debuginfo.sh +%global _missing_build_ids_terminate_build 1 +%global _no_recompute_build_ids 1 +%undefine _include_minidebuginfo +%undefine _include_gdb_index +%undefine _unique_build_ids + +%define with_source 1 + +%define with_python2 0 + +# failed if there is new config options +%define listnewconfig_fail 0 + +%ifarch aarch64 +%define with_64kb %{?_with_64kb: 1} %{?!_with_64kb: 0} +%if %{with_64kb} +%global package64kb -64kb +%endif +%else +%define with_64kb 0 +%endif + +#default is enabled. You can disable it with --without option +%define with_perf %{?_without_perf: 0} %{?!_without_perf: 1} + +Name: kernel-rt%{?package64kb} +Version: %{upstream_version}.%{upstream_sublevel} +Release: %{devel_release}%{?maintenance_release}%{?rt_release}%{?pkg_release} +Summary: Linux Kernel +License: GPLv2 +URL: http://www.kernel.org/ +Source0: kernel.tar.gz +Source10: sign-modules +Source11: x509.genkey +Source12: extra_certificates + +%if 0%{?openEuler_sign_rsa} +Source15: openeuler_kernel_cert.cer +Source16: sign-modules-openeuler +%endif + +%if 0%{?with_kabichk} +Source18: check-kabi +Source20: Module.kabi_aarch64 +Source21: Module.kabi_x86_64 +%endif + +Source200: mkgrub-menu-aarch64.sh + +Source2000: cpupower.service +Source2001: cpupower.config + +%if 0%{?with_patch} +Source9000: apply-patches +Source9001: guards +Source9002: series.conf +Source9998: patches.tar.bz2 +%endif + +Patch0002: 0002-cpupower-clang-compile-support.patch +Patch0003: 0003-x86_energy_perf_policy-clang-compile-support.patch +Patch0004: 0004-turbostat-clang-compile-support.patch +Patch0: patch-6.6.0-6.0.0-rt20.patch +Patch1: patch-6.6.0-6.0.0-rt20.patch-openeuler_defconfig.patch +#BuildRequires: +BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, tar +BuildRequires: bzip2, xz, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk +BuildRequires: libcap-devel, libcap-ng-devel, rsync +BuildRequires: gcc >= 3.4.2, binutils >= 2.12 +BuildRequires: hostname, net-tools, bc +BuildRequires: xmlto, asciidoc +BuildRequires: openssl-devel openssl +BuildRequires: hmaccalc +BuildRequires: ncurses-devel +#BuildRequires: pesign >= 0.109-4 +BuildRequires: elfutils-libelf-devel +BuildRequires: rpm >= 4.14.2 +#BuildRequires: sparse >= 0.4.1 +%if 0%{?with_python2} +BuildRequires: python-devel +%endif + +BuildRequires: elfutils-devel zlib-devel binutils-devel newt-devel perl(ExtUtils::Embed) bison +BuildRequires: audit-libs-devel libpfm-devel libtraceevent-devel +BuildRequires: pciutils-devel gettext +BuildRequires: rpm-build, elfutils +BuildRequires: numactl-devel python3-devel glibc-static python3-docutils +BuildRequires: perl-generators perl(Carp) libunwind-devel gtk2-devel libbabeltrace-devel java-1.8.0-openjdk java-1.8.0-openjdk-devel perl-devel + +AutoReq: no +AutoProv: yes + +Conflicts: device-mapper-libs < 1.02.63-2 e2fsprogs < 1.37-4 initscripts < 7.23 iptables < 1.3.2-1 +Conflicts: ipw2200-firmware < 2.4 isdn4k-utils < 3.2-32 iwl4965-firmware < 228.57.2 jfsutils < 1.1.7-2 +Conflicts: mdadm < 3.2.1-5 nfs-utils < 1.0.7-12 oprofile < 0.9.1-2 ppp < 2.4.3-3 procps < 3.2.5-6.3 +Conflicts: reiserfs-utils < 3.6.19-2 selinux-policy-targeted < 1.25.3-14 squashfs-tools < 4.0 +Conflicts: udev < 063-6 util-linux < 2.12 wireless-tools < 29-3 xfsprogs < 2.6.13-4 + +Provides: kernel-rt-%{_target_cpu} = %{version}-%{release} kernel-rt-drm = 4.3.0 kernel-rt-drm-nouveau = 16 kernel-rt-modeset = 1 +Provides: kernel-rt-uname-r = %{KernelVer} kernel-rt=%{KernelVer} + +Requires: dracut >= 001-7 grubby >= 8.28-2 initscripts >= 8.11.1-1 linux-firmware >= 20100806-2 module-init-tools >= 3.16-2 + +ExclusiveArch: noarch aarch64 i686 x86_64 riscv64 ppc64le loongarch64 +ExclusiveOS: Linux + +%if %{with_perf} +BuildRequires: flex xz-devel libzstd-devel +BuildRequires: java-devel +%ifarch aarch64 +BuildRequires: OpenCSD +%endif +%endif + +BuildRequires: dwarves +BuildRequires: clang >= 10.0.0 +BuildRequires: llvm +BuildRequires: llvm-devel +%if %{with clang_lto} +BuildRequires: lld +%endif + +%description +The Linux Kernel, the operating system core itself. + +%package headers +Summary: Header files for the Linux kernel for use by glibc +Obsoletes: glibc-kernheaders < 3.0-46 +Provides: glibc-kernheaders = 3.0-46 +%description headers +Kernel-headers includes the C header files that specify the interface +between the Linux kernel and userspace libraries and programs. The +header files define structures and constants that are needed for +building most standard programs and are also needed for rebuilding the +glibc package. + + +%package devel +Summary: Development package for building kernel modules to match the %{KernelVer} kernel +AutoReqProv: no +Provides: kernel-rt-devel-uname-r = %{KernelVer} +Provides: kernel-rt-devel-%{_target_cpu} = %{version}-%{release} +Requires: perl findutils + +%description devel +This package provides kernel headers and makefiles sufficient to build modules +against the %{KernelVer} kernel package. + +%package tools +Summary: Assortment of tools for the Linux kernel +Provides: %{name}-tools-libs +Obsoletes: %{name}-tools-libs +Provides: cpufreq-utils = 1:009-0.6.p1 +Provides: cpufrequtils = 1:009-0.6.p1 +Obsoletes: cpufreq-utils < 1:009-0.6.p1 +Obsoletes: cpufrequtils < 1:009-0.6.p1 +Obsoletes: cpuspeed < 1:1.5-16 +%description tools +This package contains the tools/ directory from the kernel source +and the supporting documentation. + +%package tools-devel +Summary: Assortment of tools for the Linux kernel +Requires: %{name}-tools = %{version}-%{release} +Requires: %{name}-tools-libs = %{version}-%{release} +Provides: %{name}-tools-libs-devel = %{version}-%{release} +Obsoletes: %{name}-tools-libs-devel +%description tools-devel +This package contains the development files for the tools/ directory from +the kernel source. + +%if %{with_perf} +%package -n perf +Summary: Performance monitoring for the Linux kernel +%description -n perf +This package contains the perf tool, which enables performance monitoring +of the Linux kernel. + +%if 0%{?with_python2} +%package -n python2-perf +Provides: python-perf = %{version}-%{release} +Obsoletes: python-perf +Summary: Python bindings for apps which will manipulate perf events + +%description -n python2-perf +A Python module that permits applications written in the Python programming +language to use the interface to manipulate perf events. +%endif + +%package -n python3-perf +Summary: Python bindings for apps which will manipulate perf events +%description -n python3-perf +A Python module that permits applications written in the Python programming +language to use the interface to manipulate perf events. +# with_perf +%endif + +%package -n bpftool +Summary: Inspection and simple manipulation of eBPF programs and maps +%description -n bpftool +This package contains the bpftool, which allows inspection and simple +manipulation of eBPF programs and maps. + +%package source +Summary: the kernel source +%description source +This package contains vaious source files from the kernel. + +%if 0%{?with_debuginfo} +%define _debuginfo_template %{nil} +%define _debuginfo_subpackages 0 + +%define debuginfo_template(n:) \ +%package -n %{-n*}-debuginfo\ +Summary: Debug information for package %{-n*}\ +Group: Development/Debug\ +AutoReq: 0\ +AutoProv: 1\ +%description -n %{-n*}-debuginfo\ +This package provides debug information for package %{-n*}.\ +Debug information is useful when developing applications that use this\ +package or when debugging this package.\ +%{nil} + +%debuginfo_template -n kernel-rt +%files -n kernel-rt-debuginfo -f kernel-debugfiles.list -f debugfiles.list +%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} --keep-section '.BTF' -p '.*/%{KernelVer}/.*|.*/vmlinux|XXX' -o kernel-debugfiles.list} + +%debuginfo_template -n bpftool +%files -n bpftool-debuginfo -f bpftool-debugfiles.list +%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%{_sbindir}/bpftool.*(\.debug)?|XXX' -o bpftool-debugfiles.list} + +%debuginfo_template -n kernel-rt-tools +%files -n kernel-rt-tools-debuginfo -f kernel-tools-debugfiles.list +%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%{_bindir}/centrino-decode.*(\.debug)?|.*%{_bindir}/powernow-k8-decode.*(\.debug)?|.*%{_bindir}/cpupower.*(\.debug)?|.*%{_libdir}/libcpupower.*|.*%{_libdir}/libcpupower.*|.*%{_bindir}/turbostat.(\.debug)?|.*%{_bindir}/.*gpio.*(\.debug)?|.*%{_bindir}/.*iio.*(\.debug)?|.*%{_bindir}/tmon.*(.debug)?|XXX' -o kernel-tools-debugfiles.list} + +%if %{with_perf} +%debuginfo_template -n perf +%files -n perf-debuginfo -f perf-debugfiles.list +%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%{_bindir}/perf.*(\.debug)?|.*%{_libexecdir}/perf-core/.*|.*%{_libdir}/traceevent/.*|XXX' -o perf-debugfiles.list} + +%if 0%{?with_python2} +%debuginfo_template -n python2-perf +%files -n python2-perf-debuginfo -f python2-perf-debugfiles.list +%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%{python2_sitearch}/perf.*(.debug)?|XXX' -o python2-perf-debugfiles.list} +%endif + +%debuginfo_template -n python3-perf +%files -n python3-perf-debuginfo -f python3-perf-debugfiles.list +%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%{python3_sitearch}/perf.*(.debug)?|XXX' -o python3-perf-debugfiles.list} +#with_perf +%endif + +%endif + +%prep +%setup -q -n kernel-%{version} -c + +%if 0%{?with_patch} +tar -xjf %{SOURCE9998} +%endif + +mv kernel linux-%{KernelVer} +cd linux-%{KernelVer} + +%if 0%{?with_patch} +cp %{SOURCE9000} . +cp %{SOURCE9001} . +cp %{SOURCE9002} . + +if [ ! -d patches ];then + mv ../patches . +fi + +Applypatches() +{ + set -e + set -o pipefail + local SERIESCONF=$1 + local PATCH_DIR=$2 + sed -i '/^#/d' $SERIESCONF + sed -i '/^[\s]*$/d' $SERIESCONF + ( + echo "trap 'echo \"*** patch \$_ failed ***\"' ERR" + echo "set -ex" + cat $SERIESCONF | \ + sed "s!^!patch -s -F0 -E -p1 --no-backup-if-mismatch -i $PATCH_DIR/!" \ + ) | sh +} + +Applypatches series.conf %{_builddir}/kernel-%{version}/linux-%{KernelVer} +%endif + +%if "%toolchain" == "clang" +%patch0002 -p1 +%patch0003 -p1 +%patch0004 -p1 +%endif +%patch0 -p1 +%patch1 -p1 + +find . \( -name "*.orig" -o -name "*~" \) -exec rm -f {} \; >/dev/null +find . -name .gitignore -exec rm -f {} \; >/dev/null + +%if 0%{?with_signmodules} + cp %{SOURCE11} certs/. +%endif + +%if 0%{?with_source} +# Copy directory backup for kernel-source +cp -a ../linux-%{KernelVer} ../linux-%{KernelVer}-source +find ../linux-%{KernelVer}-source -type f -name "\.*" -exec rm -rf {} \; >/dev/null +%endif + +cp -a tools/perf tools/python3-perf + +%build +cd linux-%{KernelVer} + +perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}.%{_target_cpu}/" Makefile + +## make linux +make mrproper %{_smp_mflags} + +%if %{with_64kb} +sed -i arch/arm64/configs/openeuler_defconfig -e 's/^CONFIG_ARM64_4K_PAGES.*/CONFIG_ARM64_64K_PAGES=y/' +sed -i arch/arm64/configs/openeuler_defconfig -e 's/^CONFIG_ARM64_PA_BITS=.*/CONFIG_ARM64_PA_BITS=52/' +sed -i arch/arm64/configs/openeuler_defconfig -e 's/^CONFIG_ARM64_PA_BITS_.*/CONFIG_ARM64_PA_BITS_52=y/' +sed -i arch/arm64/configs/openeuler_defconfig -e 's/^CONFIG_ARM64_VA_BITS=.*/CONFIG_ARM64_VA_BITS=52/' +sed -i arch/arm64/configs/openeuler_defconfig -e 's/^CONFIG_ARM64_VA_BITS_.*/CONFIG_ARM64_VA_BITS_52=y/' +%endif + +%if "%toolchain" == "clang" + +%ifarch s390x ppc64le +%global llvm_ias 0 +%else +%global llvm_ias 1 +%endif + +%global clang_make_opts HOSTCC=clang CC=clang LLVM_IAS=%{llvm_ias} + +%if %{with clang_lto} +%global clang_make_opts %{clang_make_opts} HOSTLD=ld.lld LD=ld.lld AR=llvm-ar NM=llvm-nm HOSTAR=llvm-ar HOSTNM=llvm-nm +%endif + +%endif + +%global make %{__make} %{?clang_make_opts} HOSTCFLAGS="%{?build_cflags}" HOSTLDFLAGS="%{?build_ldflags}" + +%ifarch loongarch64 + +%if 0%{with_signmodules} +echo "CONFIG_MODULE_SIG=y" >>arch/loongarch/configs/loongson3_defconfig +%endif + +%if 0%{with_debuginfo} +echo "CONFIG_DEBUG_INFO=y" >>arch/loongarch/configs/loongson3_defconfig +%endif + +make ARCH=%{Arch} loongson3_defconfig + +%else +%{make} ARCH=%{Arch} openeuler_defconfig +%endif + +%if %{with clang_lto} +scripts/config -e LTO_CLANG_FULL +sed -i 's/# CONFIG_LTO_CLANG_FULL is not set/CONFIG_LTO_CLANG_FULL=y/' .config +sed -i 's/CONFIG_LTO_NONE=y/# CONFIG_LTO_NONE is not set/' .config +%endif + +%if 0%{?openEuler_sign_rsa} + %{openEuler_check_EBS_perm} + if [ $openEuler_has_sign_perm -eq 1 ]; then + cp %{SOURCE15} ./certs/openeuler-cert.pem + # close kernel native signature + sed -i 's/CONFIG_MODULE_SIG_KEY=.*$/CONFIG_MODULE_SIG_KEY=""/g' .config + sed -i 's/CONFIG_SYSTEM_TRUSTED_KEYS=.*$/CONFIG_SYSTEM_TRUSTED_KEYS="certs\/openeuler-cert.pem"/g' .config + sed -i 's/CONFIG_MODULE_SIG_ALL=y$/CONFIG_MODULE_SIG_ALL=n/g' .config + fi +%endif + +TargetImage=$(basename $(make -s image_name)) + +%{make} ARCH=%{Arch} $TargetImage %{?_smp_mflags} +%{make} ARCH=%{Arch} modules %{?_smp_mflags} + +%if 0%{?with_kabichk} + chmod 0755 %{SOURCE18} + if [ -e $RPM_SOURCE_DIR/Module.kabi_%{_target_cpu} ]; then + %{SOURCE18} -k $RPM_SOURCE_DIR/Module.kabi_%{_target_cpu} -s Module.symvers || exit 1 + else + echo "**** NOTE: Cannot find reference Module.kabi file. ****" + fi +%endif + +# aarch64 make dtbs +%ifarch aarch64 riscv64 + %{make} ARCH=%{Arch} dtbs +%endif + +## make tools +%if %{with_perf} +# perf +%ifarch aarch64 +# aarch64 make perf with CORESIGHT=1 +%global perf_make \ + make %{?clang_make_opts} EXTRA_LDFLAGS="%[ "%{toolchain}" == "clang" ? "-z now" : "" ]" EXTRA_CFLAGS="%[ "%{toolchain}" == "clang" ? "" : "-Wl,-z,now" ] -g -Wall -fstack-protector-strong -fPIC" EXTRA_PERFLIBS="-fpie -pie" %{?_smp_mflags} -s V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_LIBNUMA=1 NO_STRLCPY=1 CORESIGHT=1 prefix=%{_prefix} +%else +%global perf_make \ + make %{?clang_make_opts} EXTRA_LDFLAGS="%[ "%{toolchain}" == "clang" ? "-z now" : "" ]" EXTRA_CFLAGS="%[ "%{toolchain}" == "clang" ? "" : "-Wl,-z,now" ] -g -Wall -fstack-protector-strong -fPIC" EXTRA_PERFLIBS="-fpie -pie" %{?_smp_mflags} -s V=1 WERROR=0 NO_LIBUNWIND=1 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_LIBNUMA=1 NO_STRLCPY=1 prefix=%{_prefix} +%endif +%if 0%{?with_python2} +%global perf_python2 -C tools/perf PYTHON=%{__python2} +%global perf_python3 -C tools/python3-perf PYTHON=%{__python3} +%else +%global perf_python3 -C tools/perf PYTHON=%{__python3} +%endif + +chmod +x tools/perf/check-headers.sh +# perf +%if 0%{?with_python2} +%{perf_make} %{perf_python2} all +%endif + +# make sure check-headers.sh is executable +chmod +x tools/python3-perf/check-headers.sh +%{perf_make} %{perf_python3} all + +pushd tools/perf/Documentation/ +%{make} %{?_smp_mflags} man +popd +%endif + +# bpftool +pushd tools/bpf/bpftool +%{make} +popd + +# cpupower +chmod +x tools/power/cpupower/utils/version-gen.sh +%{make} %{?_smp_mflags} -C tools/power/cpupower CPUFREQ_BENCH=false +%ifarch %{ix86} + pushd tools/power/cpupower/debug/i386 + %{make} %{?_smp_mflags} centrino-decode powernow-k8-decode + popd +%endif +%ifarch x86_64 + pushd tools/power/cpupower/debug/x86_64 + %{make} %{?_smp_mflags} centrino-decode powernow-k8-decode + popd +%endif +%ifarch %{ix86} x86_64 + pushd tools/power/x86/x86_energy_perf_policy/ + %{make} + popd + pushd tools/power/x86/turbostat + %{make} + popd +%endif +# thermal +pushd tools/thermal/tmon/ +%{make} +popd +# iio +pushd tools/iio/ +%{make} +popd +# gpio +pushd tools/gpio/ +%{make} +popd +# kvm +pushd tools/kvm/kvm_stat/ +%{make} %{?_smp_mflags} man +popd +# libbpf.a and bpf_helper_defs.h +pushd tools/lib/bpf +%{make} +popd +# netacc +pushd tools/netacc +%{make} BPFTOOL=../../tools/bpf/bpftool/bpftool +popd + +%install +%if 0%{?with_source} + %define _python_bytecompile_errors_terminate_build 0 + mkdir -p $RPM_BUILD_ROOT/usr/src/ + mv linux-%{KernelVer}-source $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer} + cp linux-%{KernelVer}/.config $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer}/ +%endif + +cd linux-%{KernelVer} + +## install linux + +# deal with kernel-source, now we don't need kernel-source +#mkdir $RPM_BUILD_ROOT/usr/src/linux-%{KernelVer} +#tar cf - --exclude SCCS --exclude BitKeeper --exclude .svn --exclude CVS --exclude .pc --exclude .hg --exclude .git --exclude=.tmp_versions --exclude=*vmlinux* --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation --exclude=.config.old --exclude=.missing-syscalls.d --exclude=patches . | tar xf - -C %{buildroot}/usr/src/linux-%{KernelVer} + +mkdir -p $RPM_BUILD_ROOT/boot +dd if=/dev/zero of=$RPM_BUILD_ROOT/boot/initramfs-%{KernelVer}.img bs=1M count=20 + +%ifarch loongarch64 +strip -s vmlinux -o vmlinux.elf +install -m 755 vmlinux.elf $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer} +%else +install -m 755 $(make -s image_name) $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer} +%endif + +%if 0%{?openEuler_sign_rsa} + %{openEuler_check_EBS_perm} + if [ $openEuler_has_sign_perm -eq 1 ]; then + echo "start sign" + %ifarch %arm aarch64 + gunzip -c $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}>$RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.unzip.efi + sh /usr/lib/rpm/brp-ebs-sign --efi $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.unzip.efi + mv $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.unzip.efi.sig $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.unzip.efi + mv $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.unzip.efi $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.unzip + gzip -c $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.unzip>$RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer} + rm -f $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.unzip + %endif + %ifarch x86_64 + mv $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer} $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.efi + sh /usr/lib/rpm/brp-ebs-sign --efi $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.efi + mv $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.efi.sig $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.efi + mv $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer}.efi $RPM_BUILD_ROOT/boot/vmlinuz-%{KernelVer} + %endif + fi +%endif + +pushd $RPM_BUILD_ROOT/boot +sha512hmac ./vmlinuz-%{KernelVer} >./.vmlinuz-%{KernelVer}.hmac +popd + +install -m 644 .config $RPM_BUILD_ROOT/boot/config-%{KernelVer} +install -m 644 System.map $RPM_BUILD_ROOT/boot/System.map-%{KernelVer} + +gzip -c9 < Module.symvers > $RPM_BUILD_ROOT/boot/symvers-%{KernelVer}.gz + +mkdir -p $RPM_BUILD_ROOT%{_sbindir} +install -m 755 %{SOURCE200} $RPM_BUILD_ROOT%{_sbindir}/mkgrub-menu-%{version}-%{devel_release}%{?maintenance_release}%{?pkg_release}.sh + + +%if 0%{?with_debuginfo} + mkdir -p $RPM_BUILD_ROOT%{debuginfodir}/lib/modules/%{KernelVer} + cp vmlinux $RPM_BUILD_ROOT%{debuginfodir}/lib/modules/%{KernelVer} +%endif + +# deal with module, if not kdump +%{make} ARCH=%{Arch} INSTALL_MOD_PATH=$RPM_BUILD_ROOT modules_install KERNELRELEASE=%{KernelVer} mod-fw= +######## to collect ko to module.filelist about netwoking. block. drm. modesetting ############### +pushd $RPM_BUILD_ROOT/lib/modules/%{KernelVer} +find -type f -name "*.ko" >modnames + +# mark modules executable so that strip-to-file can strip them +xargs --no-run-if-empty chmod u+x < modnames + +# Generate a list of modules for block and networking. + +grep -F /drivers/ modnames | xargs --no-run-if-empty nm -upA | +sed -n 's,^.*/\([^/]*\.ko\): *U \(.*\)$,\1 \2,p' > drivers.undef + +collect_modules_list() +{ + sed -r -n -e "s/^([^ ]+) \\.?($2)\$/\\1/p" drivers.undef | + LC_ALL=C sort -u > modules.$1 + if [ ! -z "$3" ]; then + sed -r -e "/^($3)\$/d" -i modules.$1 + fi +} + +collect_modules_list networking \ + 'register_netdev|ieee80211_register_hw|usbnet_probe|phy_driver_register|rt2x00(pci|usb)_probe|register_netdevice' +collect_modules_list block \ + 'ata_scsi_ioctl|scsi_add_host|scsi_add_host_with_dma|blk_alloc_queue|blk_init_queue|register_mtd_blktrans|scsi_esp_register|scsi_register_device_handler|blk_queue_physical_block_size|ahci_platform_get_resources' 'pktcdvd.ko|dm-mod.ko' +collect_modules_list drm \ + 'drm_open|drm_init' +collect_modules_list modesetting \ + 'drm_crtc_init' + +# detect missing or incorrect license tags +rm -f modinfo +while read i +do + echo -n "$i " >> modinfo + /sbin/modinfo -l $i >> modinfo +done < modnames + +grep -E -v \ + 'GPL( v2)?$|Dual BSD/GPL$|Dual MPL/GPL$|GPL and additional rights$' \ + modinfo && exit 1 + +rm -f modinfo modnames drivers.undef + +for i in alias alias.bin builtin.bin ccwmap dep dep.bin ieee1394map inputmap isapnpmap ofmap pcimap seriomap symbols symbols.bin usbmap +do + rm -f $RPM_BUILD_ROOT/lib/modules/$KernelVer/modules.$i +done +popd +# modsign module ko;need after find-debuginfo,strip +%define __modsign_install_post \ + if [ "%{with_signmodules}" -eq "1" ];then \ + cp certs/signing_key.pem . \ + cp certs/signing_key.x509 . \ + chmod 0755 %{modsign_cmd} \ + %{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KernelVer} || exit 1 \ + fi \ + find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -n1 -P`nproc --all` xz; \ +%{nil} + +%if 0%{?openEuler_sign_rsa} +%define __modsign_install_post \ + if [ "%{with_signmodules}" -eq "1" ];then \ + if [ %flag_openEuler_has_sign_perm -eq 1 ]; then \ + sh %{SOURCE16} $RPM_BUILD_ROOT/lib/modules/%{KernelVer} || exit 1 \ + else \ + cp certs/signing_key.pem . \ + cp certs/signing_key.x509 . \ + chmod 0755 %{modsign_cmd} \ + %{modsign_cmd} $RPM_BUILD_ROOT/lib/modules/%{KernelVer} || exit 1 \ + fi \ + fi \ + find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -n1 -P`nproc --all` xz; \ +%{nil} +%endif + +# deal with header +%{make} ARCH=%{Arch} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr KBUILD_SRC= headers_install +find $RPM_BUILD_ROOT/usr/include -name "\.*" -exec rm -rf {} \; + +# dtbs install +%ifarch aarch64 riscv64 + mkdir -p $RPM_BUILD_ROOT/boot/dtb-%{KernelVer} + install -m 644 $(find arch/%{Arch}/boot -name "*.dtb") $RPM_BUILD_ROOT/boot/dtb-%{KernelVer}/ + rm -f $(find arch/$Arch/boot -name "*.dtb") +%endif + +# deal with vdso +%ifnarch ppc64le +%{make} -s ARCH=%{Arch} INSTALL_MOD_PATH=$RPM_BUILD_ROOT vdso_install KERNELRELEASE=%{KernelVer} +%endif +if [ ! -s ldconfig-kernel.conf ]; then + echo "# Placeholder file, no vDSO hwcap entries used in this kernel." >ldconfig-kernel.conf +fi +install -D -m 444 ldconfig-kernel.conf $RPM_BUILD_ROOT/etc/ld.so.conf.d/kernel-%{KernelVer}.conf + +# deal with /lib/module/ path- sub path: build source kernel +rm -f $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build +rm -f $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/source +mkdir -p $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build +mkdir -p $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/extra +mkdir -p $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/updates +mkdir -p $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/weak-updates +############ to do collect devel file ######### +# 1. Makefile And Kconfig, .config sysmbol +# 2. scrpits dir +# 3. .h file +find -type f \( -name "Makefile*" -o -name "Kconfig*" \) -exec cp --parents {} $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build \; +for f in Module.symvers System.map Module.markers .config;do + test -f $f || continue + cp $f $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build +done + +cp -a scripts $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build +if [ -d arch/%{Arch}/scripts ]; then + cp -a arch/%{Arch}/scripts $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/arch/%{_arch} || : +fi +if [ -f arch/%{Arch}/*lds ]; then + cp -a arch/%{Arch}/*lds $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/arch/%{_arch}/ || : +fi +find $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/scripts/ -name "*.o" -exec rm -rf {} \; + +if [ -d arch/%{Arch}/include ]; then + cp -a --parents arch/%{Arch}/include $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/ +fi +cp -a include $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/include + +if [ -f arch/%{Arch}/kernel/module.lds ]; then + cp -a --parents arch/%{Arch}/kernel/module.lds $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/ +fi + +# module.lds is moved to scripts by commit 596b0474d3d9 in linux 5.10. +if [ -f scripts/module.lds ]; then + cp -a --parents scripts/module.lds $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/ +fi + +%ifarch aarch64 + cp -a --parents arch/arm/include/asm $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/ +%endif + +# copy objtool for kernel-devel (needed for building external modules) +if grep -q CONFIG_OBJTOOL=y .config; then + mkdir -p $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/tools/objtool + cp -a tools/objtool/objtool $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/tools/objtool +fi + +# Make sure the Makefile and version.h have a matching timestamp so that +# external modules can be built +touch -r $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/Makefile $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/include/generated/uapi/linux/version.h +touch -r $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/.config $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/include/generated/autoconf.h +# for make prepare +if [ ! -f $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/include/config/auto.conf ];then + cp .config $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build/include/config/auto.conf +fi + +mkdir -p %{buildroot}/usr/src/kernels +mv $RPM_BUILD_ROOT/lib/modules/%{KernelVer}/build $RPM_BUILD_ROOT/usr/src/kernels/%{KernelVer} + +find $RPM_BUILD_ROOT/usr/src/kernels/%{KernelVer} -name ".*.cmd" -exec rm -f {} \; + +pushd $RPM_BUILD_ROOT/lib/modules/%{KernelVer} +ln -sf /usr/src/kernels/%{KernelVer} build +ln -sf build source +popd + + +# deal with doc , now we don't need + + +# deal with kernel abi whitelists. now we don't need + + +## install tools +%if %{with_perf} +# perf +# perf tool binary and supporting scripts/binaries +%if 0%{?with_python2} +%{perf_make} %{perf_python2} DESTDIR=%{buildroot} lib=%{_lib} install-bin +%else +%{perf_make} %{perf_python3} DESTDIR=%{buildroot} lib=%{_lib} install-bin +%endif +# remove the 'trace' symlink. +rm -f %{buildroot}%{_bindir}/trace + +# remove examples +rm -rf %{buildroot}/usr/lib/perf/examples +# remove the stray header file that somehow got packaged in examples +rm -rf %{buildroot}/usr/lib/perf/include/bpf/ + +# python-perf extension +%{perf_make} %{perf_python3} DESTDIR=%{buildroot} install-python_ext +%if 0%{?with_python2} +%{perf_make} %{perf_python2} DESTDIR=%{buildroot} install-python_ext +%endif + +# perf man pages (note: implicit rpm magic compresses them later) +install -d %{buildroot}/%{_mandir}/man1 +install -pm0644 tools/kvm/kvm_stat/kvm_stat.1 %{buildroot}/%{_mandir}/man1/ +install -pm0644 tools/perf/Documentation/*.1 %{buildroot}/%{_mandir}/man1/ +%endif + +# bpftool +pushd tools/bpf/bpftool +%{make} DESTDIR=%{buildroot} prefix=%{_prefix} bash_compdir=%{_sysconfdir}/bash_completion.d/ mandir=%{_mandir} install doc-install +popd + +# resolve_btfids +mkdir -p %{buildroot}/usr/src/kernels/%{KernelVer}/tools/bpf/resolve_btfids +cp tools/bpf/resolve_btfids/resolve_btfids %{buildroot}/usr/src/kernels/%{KernelVer}/tools/bpf/resolve_btfids + +# cpupower +%{make} -C tools/power/cpupower DESTDIR=%{buildroot} libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install +rm -f %{buildroot}%{_libdir}/*.{a,la} +%find_lang cpupower +mv cpupower.lang ../ +%ifarch %{ix86} + pushd tools/power/cpupower/debug/i386 + install -m755 centrino-decode %{buildroot}%{_bindir}/centrino-decode + install -m755 powernow-k8-decode %{buildroot}%{_bindir}/powernow-k8-decode + popd +%endif +%ifarch x86_64 + pushd tools/power/cpupower/debug/x86_64 + install -m755 centrino-decode %{buildroot}%{_bindir}/centrino-decode + install -m755 powernow-k8-decode %{buildroot}%{_bindir}/powernow-k8-decode + popd +%endif +chmod 0755 %{buildroot}%{_libdir}/libcpupower.so* +mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig +install -m644 %{SOURCE2000} %{buildroot}%{_unitdir}/cpupower.service +install -m644 %{SOURCE2001} %{buildroot}%{_sysconfdir}/sysconfig/cpupower +%ifarch %{ix86} x86_64 + mkdir -p %{buildroot}%{_mandir}/man8 + pushd tools/power/x86/x86_energy_perf_policy + %{make} DESTDIR=%{buildroot} install + popd + pushd tools/power/x86/turbostat + %{make} DESTDIR=%{buildroot} install + popd +%endif +# thermal +pushd tools/thermal/tmon +%{make} INSTALL_ROOT=%{buildroot} install +popd +# iio +pushd tools/iio +%{make} DESTDIR=%{buildroot} install +popd +# gpio +pushd tools/gpio +%{make} DESTDIR=%{buildroot} install +popd +# kvm +pushd tools/kvm/kvm_stat +%{make} INSTALL_ROOT=%{buildroot} install-tools +popd +# netacc +pushd tools/netacc +%{make} INSTALL_ROOT=%{buildroot} install +popd + +%define __spec_install_post\ +%{?__debug_package:%{__debug_install_post}}\ +%{__arch_install_post}\ +%{__os_install_post}\ +%{__modsign_install_post}\ +%{nil} + +%post +%{_sbindir}/new-kernel-pkg --package kernel --install %{KernelVer} || exit $? + +%preun +if [ `uname -i` == "aarch64" ] && + [ -f /boot/EFI/grub2/grub.cfg ]; then + /usr/bin/sh %{_sbindir}/mkgrub-menu-%{version}-%{devel_release}%{?maintenance_release}%{?pkg_release}.sh %{version}-%{release}.aarch64 /boot/EFI/grub2/grub.cfg remove +fi + +%postun +%{_sbindir}/new-kernel-pkg --rminitrd --rmmoddep --remove %{KernelVer} || exit $? +if [ -x %{_sbindir}/weak-modules ] +then + %{_sbindir}/weak-modules --remove-kernel %{KernelVer} || exit $? +fi + +# remove empty directory +if [ -d /lib/modules/%{KernelVer} ] && [ "`ls -A /lib/modules/%{KernelVer}`" = "" ]; then + rm -rf /lib/modules/%{KernelVer} +fi +if [ `uname -i` == "loongarch64" ];then + [ -f /etc/grub2.cfg ] && GRUB_CFG=`readlink -f /etc/grub2.cfg` + [ "x${GRUB_CFG}" == "x" ] && [ -f /etc/grub2-efi.cfg ] && GRUB_CFG=`readlink -f /etc/grub2-efi.cfg` + [ "x${GRUB_CFG}" == "x" ] && [ -f /boot/efi/EFI/openEuler/grub.cfg ] && GRUB_CFG=/boot/efi/EFI/openEuler/grub.cfg + [ "x${GRUB_CFG}" != "x" ] && grub2-mkconfig -o ${GRUB_CFG} +fi + +%posttrans +%{_sbindir}/new-kernel-pkg --package kernel --mkinitrd --dracut --depmod --update %{KernelVer} || exit $? +%{_sbindir}/new-kernel-pkg --package kernel --rpmposttrans %{KernelVer} || exit $? +if [ `uname -i` == "aarch64" ] && + [ -f /boot/EFI/grub2/grub.cfg ]; then + /usr/bin/sh %{_sbindir}/mkgrub-menu-%{version}-%{devel_release}%{?maintenance_release}%{?pkg_release}.sh %{version}-%{release}.aarch64 /boot/EFI/grub2/grub.cfg update +fi +if [ `uname -i` == "loongarch64" ];then + [ -f /etc/grub2.cfg ] && GRUB_CFG=`readlink -f /etc/grub2.cfg` + [ "x${GRUB_CFG}" == "x" ] && [ -f /etc/grub2-efi.cfg ] && GRUB_CFG=`readlink -f /etc/grub2-efi.cfg` + [ "x${GRUB_CFG}" == "x" ] && [ -f /boot/efi/EFI/openEuler/grub.cfg ] && GRUB_CFG=/boot/efi/EFI/openEuler/grub.cfg + [ "x${GRUB_CFG}" != "x" ] && grub2-mkconfig -o ${GRUB_CFG} + grubby --set-default=/boot/vmlinuz-%{KernelVer} +fi +if [ -x %{_sbindir}/weak-modules ] +then + %{_sbindir}/weak-modules --add-kernel %{KernelVer} || exit $? +fi +%{_sbindir}/new-kernel-pkg --package kernel --mkinitrd --dracut --depmod --update %{KernelVer} || exit $? +%{_sbindir}/new-kernel-pkg --package kernel --rpmposttrans %{KernelVer} || exit $? + +%post devel +if [ -f /etc/sysconfig/kernel ] +then + . /etc/sysconfig/kernel || exit $? +fi +if [ "$HARDLINK" != "no" -a -x /usr/sbin/hardlink ] +then + (cd /usr/src/kernels/%{KernelVer} && + /usr/bin/find . -type f | while read f; do + hardlink -c /usr/src/kernels/*.oe*.*/$f $f + done) +fi + +%post -n %{name}-tools +/sbin/ldconfig +%systemd_post cpupower.service + +%preun -n %{name}-tools +%systemd_preun cpupower.service + +%postun -n %{name}-tools +/sbin/ldconfig +%systemd_postun cpupower.service + +%files +%defattr (-, root, root) +%doc +/boot/config-* +%ifarch aarch64 riscv64 +/boot/dtb-* +%endif +/boot/symvers-* +/boot/System.map-* +/boot/vmlinuz-* +%ghost /boot/initramfs-%{KernelVer}.img +/boot/.vmlinuz-*.hmac +/etc/ld.so.conf.d/* +/lib/modules/%{KernelVer}/ +%exclude /lib/modules/%{KernelVer}/source +%exclude /lib/modules/%{KernelVer}/build +%{_sbindir}/mkgrub-menu*.sh + +%files devel +%defattr (-, root, root) +%doc +/lib/modules/%{KernelVer}/source +/lib/modules/%{KernelVer}/build +/usr/src/kernels/%{KernelVer} + +%files headers +%defattr (-, root, root) +/usr/include/* +%exclude %{_includedir}/cpufreq.h +%exclude %{_includedir}/cpuidle.h + +%if %{with_perf} +%files -n perf +%{_bindir}/perf +%{_libdir}/libperf-jvmti.so +%{_libexecdir}/perf-core +%{_datadir}/perf-core/ +%{_mandir}/man[1-8]/perf* +%{_sysconfdir}/bash_completion.d/perf +%doc linux-%{KernelVer}/tools/perf/Documentation/examples.txt +%dir %{_datadir}/doc/perf-tip +%{_datadir}/doc/perf-tip/* +%license linux-%{KernelVer}/COPYING + +%if 0%{?with_python2} +%files -n python2-perf +%license linux-%{KernelVer}/COPYING +%{python2_sitearch}/* +%endif + +%files -n python3-perf +%license linux-%{KernelVer}/COPYING +%{python3_sitearch}/* +%endif + +%files -n %{name}-tools -f cpupower.lang +%{_bindir}/cpupower +%ifarch %{ix86} x86_64 +%{_bindir}/centrino-decode +%{_bindir}/powernow-k8-decode +%endif +%{_unitdir}/cpupower.service +%{_datadir}/bash-completion/completions/cpupower +%{_mandir}/man[1-8]/cpupower* +%config(noreplace) %{_sysconfdir}/sysconfig/cpupower +%ifarch %{ix86} x86_64 +%{_bindir}/x86_energy_perf_policy +%{_mandir}/man8/x86_energy_perf_policy* +%{_bindir}/turbostat +%{_mandir}/man8/turbostat* +%endif +%{_bindir}/tmon +%{_bindir}/iio_event_monitor +%{_bindir}/iio_generic_buffer +%{_bindir}/lsiio +%{_bindir}/lsgpio +%{_bindir}/gpio-hammer +%{_bindir}/gpio-event-mon +%{_bindir}/gpio-watch +%{_mandir}/man1/kvm_stat* +%{_bindir}/kvm_stat +%{_sbindir}/net-acc +%{_sbindir}/tuned_acc/netacc +%{_libdir}/libcpupower.so.1 +%{_libdir}/libcpupower.so.0.0.1 +%license linux-%{KernelVer}/COPYING + +%files -n %{name}-tools-devel +%{_libdir}/libcpupower.so +%{_includedir}/cpufreq.h +%{_includedir}/cpuidle.h + +%files -n bpftool +%{_sbindir}/bpftool +%{_sysconfdir}/bash_completion.d/bpftool +%{_mandir}/man8/bpftool-cgroup.8.gz +%{_mandir}/man8/bpftool-map.8.gz +%{_mandir}/man8/bpftool-prog.8.gz +%{_mandir}/man8/bpftool-perf.8.gz +%{_mandir}/man8/bpftool.8.gz +%{_mandir}/man8/bpftool-btf.8.gz +%{_mandir}/man8/bpftool-feature.8.gz +%{_mandir}/man8/bpftool-gen.8.gz +%{_mandir}/man8/bpftool-iter.8.gz +%{_mandir}/man8/bpftool-link.8.gz +%{_mandir}/man8/bpftool-net.8.gz +%{_mandir}/man8/bpftool-struct_ops.8.gz +%license linux-%{KernelVer}/COPYING + +%if 0%{?with_source} +%files source +%defattr(-,root,root) +/usr/src/linux-%{KernelVer}/* +/usr/src/linux-%{KernelVer}/.config +%endif + +%changelog +* Mon May 10 2024 zhangyu - 6.6.0-25.0.0.1 +- update kernel-rt version to 6.6.0-25.0.0.1 + +* Thu May 09 2024 ZhangPeng - 6.6.0-25.0.0.28 +- !6930 fix general protection fault in update_cpumask +- cgroup/cpuset: fix general protection fault in update_cpumask +- !6905 v2 arm64: mmap: disable align larger anonymous mappings on THP boundaries +- arm64: mmap: disable align larger anonymous mappings on THP boundaries +- !7015 Fixes and cleanups to fs-writeback +- fs/writeback: remove unnecessary return in writeback_inodes_sb +- fs/writeback: correct comment of __wakeup_flusher_threads_bdi +- fs/writeback: only calculate dirtied_before when b_io is empty +- fs/writeback: remove unused parameter wb of finish_writeback_work +- fs/writeback: bail out if there is no more inodes for IO and queued once +- fs/writeback: avoid to writeback non-expired inode in kupdate writeback +- !6581 LoongArch: fix KASLR can not be disabled by nokaslr when boot from old BPI +- LoongArch: fix KASLR can not be disabled by nokaslr when boot from old BPI +- !6483 LoongArch: fix boot error caused by ioremap_page_range error +- LoongArch: fix boot error caused by ioremap_page_range error +- !6759 net: hns3: backport some maillist patches +- net: hns3: move constants from hclge_debugfs.h to hclge_debugfs.c +- net: hns3: dump more reg info based on ras mod +- net: hns3: add command queue trace for hns3 +- net: hns3: add support to query scc version by devlink info +- net: hns3: revert "net: hns3: dump more reg info based on ras mod" +- net: hns3: revert "net: hns3: add command queue trace for hns3" +- net: hns3: revert "net: hns3: add support to query scc version by devlink info" +- !7011 v3 bugfix patches from OLK-5.10 +- x86/quirks: Add parameter to clear MSIs early on boot +- x86/PCI: Export find_cap() to be used in early PCI code +- !6844 block: fix deadlock between bd_link_disk_holder and partition scan +- block: fix deadlock between bd_link_disk_holder and partition scan +- !5879 [OLK-6.6] Fix 'duplicate symbol rnp10_netdev_ops' error for RNPGBE driver with x86_64-allyesconfig +- RNPGBE: NET: Fix 'duplicate symbol rnp10_netdev_ops' errors +- !5836 [OLK-6.6] Fix "'snprintf' output between 10 and 37 bytes into a destination of size 24" warning for RNP driver with loongarch-allmodconfig +- RNP: NET: Fix "'snprintf' output between 10 and 37 bytes into a destination of size 24" wanrings + +* Wed May 08 2024 ZhangPeng - 6.6.0-24.0.0.27 +- !6824 Introduce CONFIG_ARCH_CUSTOM_NUMA_DISTANCE +- config: enable COBFIG_ARCH_CUSTOM_NUMA_DISTANCE for arm64 +- arm64/numa: Support node_reclaim_distance adjust for arch +- !6877 maple_tree: avoid checking other gaps after getting the largest gap +- maple_tree: avoid checking other gaps after getting the largest gap +- !6859 [openEuler-24.03-LTS][linux-6.6.y sync] Backport 6.6.23-6.6.30 LTS Patches +- x86: update openeuler_defconfig for x86_64 +- bounds: Use the right number of bits for power-of-two CONFIG_NR_CPUS +- net/mlx5e: Advertise mlx5 ethernet driver updates sk_buff md_dst for MACsec +- macsec: Detect if Rx skb is macsec-related for offloading devices that update md_dst +- macsec: Enable devices to advertise whether they update sk_buff md_dst during offloads +- Revert "riscv: kdump: fix crashkernel reserving problem on RISC-V" +- ovl: fix memory leak in ovl_parse_param() +- phy: qcom: qmp-combo: fix VCO div offset on v5_5nm and v6 +- i2c: smbus: fix NULL function pointer dereference +- sched/eevdf: Prevent vlag from going out of bounds in reweight_eevdf() +- sched/eevdf: Fix miscalculation in reweight_entity() when se is not curr +- sched/eevdf: Always update V if se->on_rq when reweighting +- phy: ti: tusb1210: Resolve charger-det crash if charger psy is unregistered +- riscv: Fix loading 64-bit NOMMU kernels past the start of RAM +- riscv: Fix TASK_SIZE on 64-bit NOMMU +- riscv: fix VMALLOC_START definition +- dmaengine: idxd: Fix oops during rmmod on single-CPU platforms +- dma: xilinx_dpdma: Fix locking +- dmaengine: idxd: Convert spinlock to mutex to lock evl workqueue +- phy: qcom: m31: match requested regulator name with dt schema +- phy: rockchip: naneng-combphy: Fix mux on rk3588 +- phy: rockchip-snps-pcie3: fix clearing PHP_GRF_PCIESEL_CON bits +- phy: rockchip-snps-pcie3: fix bifurcation on rk3588 +- phy: freescale: imx8m-pcie: fix pcie link-up instability +- phy: marvell: a3700-comphy: Fix hardcoded array size +- phy: marvell: a3700-comphy: Fix out of bounds read +- soundwire: amd: fix for wake interrupt handling for clockstop mode +- idma64: Don't try to serve interrupts when device is powered off +- dmaengine: tegra186: Fix residual calculation +- dmaengine: owl: fix register access functions +- x86/tdx: Preserve shared bit on mprotect() +- phy: qcom: qmp-combo: Fix VCO div offset on v3 +- phy: qcom: qmp-combo: Fix register base for QSERDES_DP_PHY_MODE +- mtd: diskonchip: work around ubsan link failure +- udp: preserve the connected status if only UDP cmsg +- fbdev: fix incorrect address computation in deferred IO +- stackdepot: respect __GFP_NOLOCKDEP allocation flag +- net: b44: set pause params only when interface is up +- ethernet: Add helper for assigning packet type when dest address does not match device address +- ACPI: CPPC: Fix access width used for PCC registers +- ACPI: CPPC: Fix bit_offset shift in MASK_VAL() macro +- ACPI: CPPC: Use access_width over bit_width for system memory accesses +- irqchip/gic-v3-its: Prevent double free on error +- drm/amdgpu: Fix leak when GPU memory allocation fails +- drm/amdgpu: Assign correct bits for SDMA HDP flush +- drm/amdgpu/sdma5.2: use legacy HDP flush for SDMA2/3 +- arm64: dts: rockchip: enable internal pull-up for Q7_THRM# on RK3399 Puma +- arm64: dts: qcom: sm8450: Fix the msi-map entries +- arm64: dts: qcom: sc8280xp: add missing PCIe minimum OPP +- LoongArch: Fix access error when read fault on a write-only VMA +- LoongArch: Fix callchain parse error with kernel tracepoint events +- cpu: Re-enable CPU mitigations by default for !X86 architectures +- btrfs: fix information leak in btrfs_ioctl_logical_to_ino() +- btrfs: scrub: run relocation repair when/only needed +- btrfs: fix wrong block_start calculation for btrfs_drop_extent_map_range() +- btrfs: fallback if compressed IO fails for ENOSPC +- HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up +- smb3: fix lock ordering potential deadlock in cifs_sync_mid_result +- smb3: missing lock when picking channel +- smb: client: Fix struct_group() usage in __packed structs +- mm: support page_mapcount() on page_has_type() pages +- mm: create FOLIO_FLAG_FALSE and FOLIO_TYPE_OPS macros +- mmc: sdhci-msm: pervent access to suspended controller +- mtd: rawnand: qcom: Fix broken OP_RESET_DEVICE command in qcom_misc_cmd_type_exec() +- Bluetooth: qca: fix NULL-deref on non-serdev setup +- Bluetooth: qca: fix NULL-deref on non-serdev suspend +- Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x0bda:0x4853 +- Bluetooth: Fix type of len in {l2cap,sco}_sock_getsockopt_old() +- rust: remove `params` from `module` macro example +- kbuild: rust: force `alloc` extern to allow "empty" Rust files +- kbuild: rust: remove unneeded `@rustc_cfg` to avoid ICE +- rust: make mutually exclusive with CFI_CLANG +- rust: init: remove impl Zeroable for Infallible +- rust: don't select CONSTRUCTORS +- x86/cpu: Fix check for RDPKRU in __show_regs() +- selftests/seccomp: Handle EINVAL on unshare(CLONE_NEWPID) +- selftests/seccomp: Change the syscall used in KILL_THREAD test +- selftests/seccomp: user_notification_addfd check nextfd is available +- Squashfs: check the inode number is not the invalid value of zero +- squashfs: convert to new timestamp accessors +- drm/amdgpu: fix visible VRAM handling during faults +- drm/amdgpu: add shared fdinfo stats +- drm: add drm_gem_object_is_shared_for_memory_stats() helper +- mm/madvise: make MADV_POPULATE_(READ|WRITE) handle VM_FAULT_RETRY properly +- mm/gup: explicitly define and check internal GUP flags, disallow FOLL_TOUCH +- KVM: x86/pmu: Set enable bits for GP counters in PERF_GLOBAL_CTRL at "RESET" +- KVM: x86/pmu: Zero out PMU metadata on AMD if PMU is disabled +- af_unix: Suppress false-positive lockdep splat for spin_lock() in __unix_gc(). +- tls: fix lockless read of strp->msg_ready in ->poll +- net: ethernet: ti: am65-cpts: Fix PTPv1 message type on TX packets +- ice: fix LAG and VF lock dependency in ice_reset_vf() +- iavf: Fix TC config comparison with existing adapter TC config +- i40e: Report MFS in decimal base instead of hex +- i40e: Do not use WQ_MEM_RECLAIM flag for workqueue +- net: ti: icssg-prueth: Fix signedness bug in prueth_init_rx_chns() +- net: phy: dp83869: Fix MII mode failure +- netfilter: nf_tables: honor table dormant flag from netdev release event path +- ARM: dts: imx6ull-tarragon: fix USB over-current polarity +- eth: bnxt: fix counting packets discarded due to OOM and netpoll +- mlxsw: spectrum_acl_tcam: Fix memory leak when canceling rehash work +- mlxsw: spectrum_acl_tcam: Fix incorrect list API usage +- mlxsw: spectrum_acl_tcam: Fix warning during rehash +- mlxsw: spectrum_acl_tcam: Fix memory leak during rehash +- mlxsw: spectrum_acl_tcam: Rate limit error message +- mlxsw: spectrum_acl_tcam: Fix possible use-after-free during rehash +- mlxsw: spectrum_acl_tcam: Fix possible use-after-free during activity update +- mlxsw: spectrum_acl_tcam: Fix race during rehash delayed work +- mlxsw: spectrum_acl_tcam: Fix race in region ID allocation +- mlxsw: Use refcount_t for reference counting +- net: openvswitch: Fix Use-After-Free in ovs_ct_exit +- ipvs: Fix checksumming on GSO of SCTP packets +- Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional() +- Bluetooth: hci_sync: Using hci_cmd_sync_submit when removing Adv Monitor +- Bluetooth: btusb: mediatek: Fix double free of skb in coredump +- Bluetooth: MGMT: Fix failing to MGMT_OP_ADD_UUID/MGMT_OP_REMOVE_UUID +- Bluetooth: hci_event: Fix sending HCI_OP_READ_ENC_KEY_SIZE +- Bluetooth: btusb: Fix triggering coredump implementation for QCA +- gpio: tegra186: Fix tegra186_gpio_is_accessible() check +- net: phy: mediatek-ge-soc: follow netdev LED trigger semantics +- net: gtp: Fix Use-After-Free in gtp_dellink +- net: usb: ax88179_178a: stop lying about skb->truesize +- ipv4: check for NULL idev in ip_route_use_hint() +- net: fix sk_memory_allocated_{add|sub} vs softirqs +- net: make SK_MEMORY_PCPU_RESERV tunable +- tools: ynl: don't ignore errors in NLMSG_DONE messages +- ax25: Fix netdev refcount issue +- NFC: trf7970a: disable all regulators on removal +- net: dsa: mv88e6xx: fix supported_interfaces setup in mv88e6250_phylink_get_caps() +- cxl/core: Fix potential payload size confusion in cxl_mem_get_poison() +- bnxt_en: Fix the PCI-AER routines +- bnxt_en: refactor reset close code +- bridge/br_netlink.c: no need to return void function +- icmp: prevent possible NULL dereferences from icmp_build_probe() +- ARM: dts: microchip: at91-sama7g5ek: Replace regulator-suspend-voltage with the valid property +- mlxsw: core_env: Fix driver initialization with old firmware +- mlxsw: core: Unregister EMAD trap using FORWARD action +- net: bcmasp: fix memory leak when bringing down interface +- vxlan: drop packets from invalid src-address +- net: libwx: fix alloc msix vectors failed +- wifi: mac80211: fix unaligned le16 access +- wifi: mac80211: remove link before AP +- wifi: mac80211_hwsim: init peer measurement result +- drm/gma500: Remove lid code +- wifi: iwlwifi: mvm: return uid from iwl_mvm_build_scan_cmd +- wifi: iwlwifi: mvm: remove old PASN station when adding a new one +- wifi: mac80211: split mesh fast tx cache into local/proxied/forwarded +- wifi: mac80211: clean up assignments to pointer cache. +- ARC: [plat-hsdk]: Remove misplaced interrupt-cells property +- gpio: tangier: Use correct type for the IRQ chip data +- arm64: dts: qcom: sc8180x: Fix ss_phy_irq for secondary USB controller +- arm64: dts: rockchip: regulator for sd needs to be always on for BPI-R2Pro +- arm64: dts: mediatek: mt2712: fix validation errors +- arm64: dts: mediatek: mt7986: prefix BPI-R3 cooling maps with "map-" +- arm64: dts: mediatek: mt7986: drop invalid thermal block clock +- arm64: dts: mediatek: mt7986: reorder nodes +- arm64: dts: mediatek: mt7986: drop "#reset-cells" from Ethernet controller +- arm64: dts: mediatek: mt7986: drop invalid properties from ethsys +- arm64: dts: mediatek: mt7986: reorder properties +- arm64: dts: mediatek: mt7622: drop "reset-names" from thermal block +- arm64: dts: mediatek: mt7622: fix ethernet controller "compatible" +- arm64: dts: mediatek: mt7622: fix IR nodename +- arm64: dts: mediatek: mt7622: fix clock controllers +- arm64: dts: mediatek: mt8183-kukui: Use default min voltage for MT6358 +- arm64: dts: mediatek: mt8195-cherry: Update min voltage constraint for MT6315 +- arm64: dts: mediatek: mt8192-asurada: Update min voltage constraint for MT6315 +- arm64: dts: mediatek: cherry: Describe CPU supplies +- arm64: dts: mediatek: cherry: Add platform thermal configuration +- arm64: dts: mediatek: mt8195: Add missing gce-client-reg to mutex1 +- arm64: dts: mediatek: mt8195: Add missing gce-client-reg to mutex +- arm64: dts: mediatek: mt8195: Add missing gce-client-reg to vpp/vdosys +- arm64: dts: mediatek: mt8192: Add missing gce-client-reg to mutex +- arm64: dts: mediatek: mt8183: Add power-domains properity to mfgcfg +- arm64: dts: rockchip: Remove unsupported node from the Pinebook Pro dts +- arm64: dts: rockchip: enable internal pull-up on PCIE_WAKE# for RK3399 Puma +- arm64: dts: rockchip: fix alphabetical ordering RK3399 puma +- arm64: dts: rockchip: enable internal pull-up on Q7_USB_ID for RK3399 Puma +- arm64: dts: rockchip: set PHY address of MT7531 switch to 0x1f +- HID: logitech-dj: allow mice to use all types of reports +- HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc +- cifs: reinstate original behavior again for forceuid/forcegid +- smb: client: fix rename(2) regression against samba +- cifs: Fix reacquisition of volume cookie on still-live connection +- selftests: kselftest: Fix build failure with NOLIBC +- thunderbolt: Reset only non-USB4 host routers in resume +- PCI/ASPM: Fix deadlock when enabling ASPM +- ksmbd: common: use struct_group_attr instead of struct_group for network_open_info +- ksmbd: clear RENAME_NOREPLACE before calling vfs_rename +- ksmbd: validate request buffer size in smb2_allocate_rsp_buf() +- ksmbd: fix slab-out-of-bounds in smb2_allocate_rsp_buf +- powerpc/ftrace: Ignore ftrace locations in exit text sections +- virtio_net: Do not send RSS key if it is not supported +- net: dsa: mt7530: fix enabling EEE on MT7531 switch on all boards +- net: dsa: mt7530: fix improper frames on all 25MHz and 40MHz XTAL MT7530 +- nilfs2: fix OOB in nilfs_set_de_type +- bootconfig: use memblock_free_late to free xbc memory to buddy +- nouveau: fix instmem race condition around ptr stores +- drm/vmwgfx: Fix crtc's atomic check conditional +- drm/vmwgfx: Sort primary plane formats by order of preference +- drm/vmwgfx: Fix prime import/export +- drm/amdgpu: remove invalid resource->start check v2 +- drm/amdkfd: Fix memory leak in create_process failure +- drm/amdgpu: validate the parameters of bo mapping operations more clearly +- fuse: fix leaked ENOSYS error on first statx call +- mm/shmem: inline shmem_is_huge() for disabled transparent hugepages +- mm/memory-failure: fix deadlock when hugetlb_optimize_vmemmap is enabled +- mm,swapops: update check in is_pfn_swap_entry for hwpoison entries +- mm/userfaultfd: allow hugetlb change protection upon poison entry +- init/main.c: Fix potential static_command_line memory overflow +- arm64: hibernate: Fix level3 translation fault in swsusp_save() +- arm64/head: Disable MMU at EL2 before clearing HCR_EL2.E2H +- KVM: x86/mmu: Write-protect L2 SPTEs in TDP MMU when clearing dirty status +- KVM: x86/pmu: Do not mask LVTPC when handling a PMI on AMD platforms +- KVM: x86/pmu: Disable support for adaptive PEBS +- KVM: x86: Snapshot if a vCPU's vendor model is AMD vs. Intel compatible +- sched: Add missing memory barrier in switch_mm_cid +- fs: sysfs: Fix reference leak in sysfs_break_active_protection() +- speakup: Avoid crash on very long word +- mei: me: disable RPL-S on SPS and IGN firmwares +- usb: gadget: f_ncm: Fix UAF ncm object at re-bind after usb ep transport error +- usb: Disable USB3 LPM at shutdown +- usb: dwc2: host: Fix dereference issue in DDMA completion flow. +- Revert "usb: cdc-wdm: close race between read and workqueue" +- USB: serial: option: add Telit FN920C04 rmnet compositions +- USB: serial: option: add Rolling RW101-GL and RW135-GL support +- USB: serial: option: support Quectel EM060K sub-models +- USB: serial: option: add Lonsung U8300/U9300 product +- USB: serial: option: add support for Fibocom FM650/FG650 +- USB: serial: option: add Fibocom FM135-GL variants +- serial: core: Fix missing shutdown and startup for serial base port +- serial: core: Clearing the circular buffer before NULLifying it +- serial: stm32: Reset .throttled state in .startup() +- serial: stm32: Return IRQ_NONE in the ISR if no handling happend +- serial/pmac_zilog: Remove flawed mitigation for rx irq flood +- serial: mxs-auart: add spinlock around changing cts state +- comedi: vmk80xx: fix incomplete endpoint checking +- thunderbolt: Fix wake configurations after device unplug +- thunderbolt: Avoid notify PM core about runtime PM resume +- binder: check offset alignment in binder_get_object() +- ALSA: hda/realtek - Enable audio jacks of Haier Boyue G42 with ALC269VC +- ALSA: hda/realtek: Add quirks for Huawei Matebook D14 NBLB-WAX9N +- ALSA: hda/tas2781: Add new vendor_id and subsystem_id to support ThinkPad ICE-1 +- ALSA: hda/tas2781: correct the register for pow calibrated data +- ALSA: seq: ump: Fix conversion from MIDI2 to MIDI1 UMP messages +- net/mlx5: E-switch, store eswitch pointer before registering devlink_param +- x86/cpufeatures: Fix dependencies for GFNI, VAES, and VPCLMULQDQ +- x86/bugs: Fix BHI retpoline check +- clk: mediatek: Do a runtime PM get on controllers during probe +- clk: Get runtime PM before walking tree for clk_summary +- clk: Show active consumers of clocks in debugfs +- clk: Get runtime PM before walking tree during disable_unused +- clk: Initialize struct clk_core kref earlier +- clk: Remove prepare_lock hold assertion in __clk_release() +- interconnect: Don't access req_list while it's being manipulated +- platform/x86/amd/pmc: Extend Framework 13 quirk to more BIOSes +- usb: new quirk to reduce the SET_ADDRESS request timeout +- usb: xhci: Add timeout argument in address_device USB HCD callback +- drm: panel-orientation-quirks: Add quirk for Lenovo Legion Go +- ALSA: scarlett2: Rename scarlett_gen2 to scarlett2 +- PCI: Simplify pcie_capability_clear_and_set_word() to ..._clear_word() +- PCI/DPC: Use FIELD_GET() +- ALSA: scarlett2: Add Focusrite Clarett 2Pre and 4Pre USB support +- ALSA: scarlett2: Add Focusrite Clarett+ 2Pre and 4Pre support +- ALSA: scarlett2: Add correct product series name to messages +- ALSA: scarlett2: Default mixer driver to enabled +- thunderbolt: Reset topology created by the boot firmware +- thunderbolt: Make tb_switch_reset() support Thunderbolt 2, 3 and USB4 routers +- thunderbolt: Introduce tb_path_deactivate_hop() +- thunderbolt: Introduce tb_port_reset() +- ASoC: ti: Convert Pandora ASoC to GPIO descriptors +- ALSA: scarlett2: Add support for Clarett 8Pre USB +- ALSA: scarlett2: Move USB IDs out from device_info struct +- drm/radeon: make -fstrict-flex-arrays=3 happy +- drm/panel: visionox-rm69299: don't unregister DSI device +- drm: nv04: Fix out of bounds access +- s390/cio: fix race condition during online processing +- s390/qdio: handle deferred cc1 +- perf lock contention: Add a missing NULL check +- RDMA/mlx5: Fix port number for counter query in multi-port configuration +- RDMA/cm: Print the old state when cm_destroy_id gets timeout +- RDMA/rxe: Fix the problem "mutex_destroy missing" +- drm/i915/mst: Limit MST+DSC to TGL+ +- net: ethernet: ti: am65-cpsw-nuss: cleanup DMA Channels before using them +- net: ethernet: mtk_eth_soc: fix WED + wifi reset +- gpiolib: swnode: Remove wrong header inclusion +- s390/ism: Properly fix receive message buffer allocation +- net: dsa: mt7530: fix port mirroring for MT7988 SoC switch +- net: dsa: mt7530: fix mirroring frames received on local port +- tun: limit printing rate when illegal packet received by tun dev +- ice: Fix checking for unsupported keys on non-tunnel device +- ice: tc: allow zero flags in parsing tc flower +- ice: tc: check src_vsi in case of traffic from VF +- net: stmmac: Fix IP-cores specific MAC capabilities +- net: stmmac: Fix max-speed being ignored on queue re-init +- net: stmmac: Apply half-duplex-less constraint for DW QoS Eth only +- octeontx2-pf: fix FLOW_DIS_IS_FRAGMENT implementation +- net: change maximum number of UDP segments to 128 +- net/mlx5e: Prevent deadlock while disabling aRFS +- net/mlx5: Lag, restore buckets number to default after hash LAG deactivation +- net: sparx5: flower: fix fragment flags handling +- af_unix: Don't peek OOB data without MSG_OOB. +- af_unix: Call manage_oob() for every skb in unix_stream_read_generic(). +- netfilter: flowtable: incorrect pppoe tuple +- netfilter: flowtable: validate pppoe header +- netfilter: nft_set_pipapo: do not free live element +- netfilter: nf_tables: Fix potential data-race in __nft_obj_type_get() +- netfilter: nf_tables: Fix potential data-race in __nft_expr_type_get() +- scsi: ufs: qcom: Add missing interconnect bandwidth values for Gear 5 +- arm64: tlb: Fix TLBI RANGE operand +- arm64/mm: Modify range-based tlbi to decrement scale +- net: usb: ax88179_178a: avoid writing the mac address before first reading +- scsi: core: Fix handling of SCMD_FAIL_IF_RECOVERING +- random: handle creditable entropy from atomic process context +- selftests/ftrace: Limit length in subsystem-enable tests +- SUNRPC: Fix rpcgss_context trace event acceptor field +- drm/i915/vma: Fix UAF on destroy against retire race +- io_uring: Fix io_cqring_wait() not restoring sigmask on get_timespec64() failure +- media: videobuf2: request more buffers for vb2_read +- drm/msm/dpu: populate SSPP scaler block version +- selftests: timers: Fix posix_timers ksft_print_msg() warning +- ceph: redirty page before returning AOP_WRITEPAGE_ACTIVATE +- ceph: rename _to_client() to _to_fs_client() +- ceph: pass the mdsc to several helpers +- drm/amd/display: Do not recursively call manual trigger programming +- selftests/timers/posix_timers: Reimplement check_timer_distribution() +- selftests: timers: Convert posix_timers test to generate KTAP output +- drm/i915: Disable live M/N updates when using bigjoiner +- drm/i915: Adjust seamless_m_n flag behaviour +- drm/i915: Enable VRR later during fastsets +- drm/i915: Extract intel_crtc_vblank_evade_scanlines() +- drm/i915: Change intel_pipe_update_{start,end}() calling convention +- drm/i915/cdclk: Fix voltage_level programming edge case +- drm/i915/mst: Reject FEC+MST on ICL +- drm/i915: Fix FEC pipe A vs. DDI A mixup +- smb: client: refresh referral without acquiring refpath_lock +- smb: client: guarantee refcounted children from parent session +- smb3: show beginning time for per share stats +- smb: client: fix UAF in smb2_reconnect_server() +- smb: client: remove extra @chan_count check in __cifs_put_smb_ses() +- drm/amd/display: fix disable otg wa logic in DCN316 +- drm/amd/display: Set VSC SDP Colorimetry same way for MST and SST +- drm/amd/display: Program VSC SDP colorimetry for all DP sinks >= 1.4 +- drm/amdgpu: fix incorrect number of active RBs for gfx11 +- drm/amdgpu: always force full reset for SOC21 +- drm/amdgpu: Reset dGPU if suspend got aborted +- drm/i915: Disable port sync when bigjoiner is used +- drm/i915/cdclk: Fix CDCLK programming order when pipes are active +- x86/bugs: Replace CONFIG_SPECTRE_BHI_{ON,OFF} with CONFIG_MITIGATION_SPECTRE_BHI +- x86/bugs: Remove CONFIG_BHI_MITIGATION_AUTO and spectre_bhi=auto +- x86/bugs: Clarify that syscall hardening isn't a BHI mitigation +- x86/bugs: Fix BHI handling of RRSBA +- x86/bugs: Rename various 'ia32_cap' variables to 'x86_arch_cap_msr' +- x86/bugs: Cache the value of MSR_IA32_ARCH_CAPABILITIES +- x86/bugs: Fix BHI documentation +- x86/bugs: Fix return type of spectre_bhi_state() +- irqflags: Explicitly ignore lockdep_hrtimer_exit() argument +- x86/apic: Force native_apic_mem_read() to use the MOV instruction +- selftests: timers: Fix abs() warning in posix_timers test +- x86/cpu: Actually turn off mitigations by default for SPECULATION_MITIGATIONS=n +- perf/x86: Fix out of range data +- vhost: Add smp_rmb() in vhost_enable_notify() +- vhost: Add smp_rmb() in vhost_vq_avail_empty() +- arm64: dts: imx8-ss-dma: fix spi lpcg indices +- arm64: dts: imx8-ss-lsio: fix pwm lpcg indices +- arm64: dts: imx8-ss-conn: fix usb lpcg indices +- arm64: dts: imx8-ss-dma: fix adc lpcg indices +- arm64: dts: imx8-ss-dma: fix can lpcg indices +- arm64: dts: imx8qm-ss-dma: fix can lpcg indices +- drm/client: Fully protect modes[] with dev->mode_config.mutex +- drm/panfrost: Fix the error path in panfrost_mmu_map_fault_addr() +- drm/ast: Fix soft lockup +- drm/amdkfd: Reset GPU on queue preemption failure +- drm/i915/vrr: Disable VRR when using bigjoiner +- drm/vmwgfx: Enable DMA mappings with SEV +- accel/ivpu: Fix deadlock in context_xa +- scsi: sg: Avoid race in error handling & drop bogus warn +- scsi: sg: Avoid sg device teardown race +- kprobes: Fix possible use-after-free issue on kprobe registration +- io_uring/net: restore msg_control on sendzc retry +- btrfs: qgroup: convert PREALLOC to PERTRANS after record_root_in_trans +- btrfs: record delayed inode root in transaction +- btrfs: qgroup: fix qgroup prealloc rsv leak in subvolume operations +- btrfs: qgroup: correctly model root qgroup rsv in convert +- selftests: mptcp: use += operator to append strings +- iommu/vt-d: Allocate local memory for page request queue +- iommu/vt-d: Fix wrong use of pasid config +- tracing: hide unused ftrace_event_id_fops +- net: ena: Set tx_info->xdpf value to NULL +- net: ena: Use tx_ring instead of xdp_ring for XDP channel TX +- net: ena: Pass ena_adapter instead of net_device to ena_xmit_common() +- net: ena: Move XDP code to its new files +- net: ena: Fix incorrect descriptor free behavior +- net: ena: Wrong missing IO completions check order +- net: ena: Fix potential sign extension issue +- af_unix: Fix garbage collector racing against connect() +- af_unix: Do not use atomic ops for unix_sk(sk)->inflight. +- net: dsa: mt7530: trap link-local frames regardless of ST Port State +- Revert "s390/ism: fix receive message buffer allocation" +- net: sparx5: fix wrong config being used when reconfiguring PCS +- net/mlx5e: Do not produce metadata freelist entries in Tx port ts WQE xmit +- net/mlx5e: HTB, Fix inconsistencies with QoS SQs number +- net/mlx5e: Fix mlx5e_priv_init() cleanup flow +- net/mlx5: Correctly compare pkt reformat ids +- net/mlx5: Properly link new fs rules into the tree +- net/mlx5: offset comp irq index in name by one +- net/mlx5: Register devlink first under devlink lock +- net/mlx5: SF, Stop waiting for FW as teardown was called +- netfilter: complete validation of user input +- Bluetooth: l2cap: Don't double set the HCI_CONN_MGMT_CONNECTED bit +- Bluetooth: SCO: Fix not validating setsockopt user input +- Bluetooth: hci_sync: Fix using the same interval and window for Coded PHY +- Bluetooth: hci_sync: Use QoS to determine which PHY to scan +- Bluetooth: ISO: Don't reject BT_ISO_QOS if parameters are unset +- Bluetooth: ISO: Align broadcast sync_timeout with connection timeout +- ipv6: fix race condition between ipv6_get_ifaddr and ipv6_del_addr +- ipv4/route: avoid unused-but-set-variable warning +- ipv6: fib: hide unused 'pn' variable +- octeontx2-af: Fix NIX SQ mode and BP config +- af_unix: Clear stale u->oob_skb. +- net: ks8851: Handle softirqs at the end of IRQ thread to fix hang +- net: ks8851: Inline ks8851_rx_skb() +- bnxt_en: Reset PTP tx_avail after possible firmware reset +- bnxt_en: Fix error recovery for RoCE ulp client +- bnxt_en: Fix possible memory leak in bnxt_rdma_aux_device_init() +- s390/ism: fix receive message buffer allocation +- geneve: fix header validation in geneve[6]_xmit_skb +- block: fix q->blkg_list corruption during disk rebind +- octeontx2-pf: Fix transmit scheduler resource leak +- xsk: validate user input for XDP_{UMEM|COMPLETION}_FILL_RING +- u64_stats: fix u64_stats_init() for lockdep when used repeatedly in one file +- net: openvswitch: fix unwanted error log on timeout policy probing +- scsi: qla2xxx: Fix off by one in qla_edif_app_getstats() +- nouveau: fix function cast warning +- Revert "drm/qxl: simplify qxl_fence_wait" +- cxl/core: Fix initialization of mbox_cmd.size_out in get event +- arm64: dts: imx8-ss-conn: fix usdhc wrong lpcg clock order +- drm/msm/dpu: don't allow overriding data from catalog +- cxl/core/regs: Fix usage of map->reg_type in cxl_decode_regblock() before assigned +- cxl/mem: Fix for the index of Clear Event Record Handle +- firmware: arm_scmi: Make raw debugfs entries non-seekable +- ARM: OMAP2+: fix USB regression on Nokia N8x0 +- mmc: omap: restore original power up/down steps +- mmc: omap: fix deferred probe +- mmc: omap: fix broken slot switch lookup +- ARM: OMAP2+: fix N810 MMC gpiod table +- ARM: OMAP2+: fix bogus MMC GPIO labels on Nokia N8x0 +- media: cec: core: remove length check of Timer Status +- PM: s2idle: Make sure CPUs will wakeup directly on resume +- ACPI: scan: Do not increase dep_unmet for already met dependencies +- platform/chrome: cros_ec_uart: properly fix race condition +- drm/amd/pm: fixes a random hang in S4 for SMU v13.0.4/11 +- Bluetooth: Fix memory leak in hci_req_sync_complete() +- ring-buffer: Only update pages_touched when a new page is touched +- raid1: fix use-after-free for original bio in raid1_write_request() +- ARM: dts: imx7s-warp: Pass OV2680 link-frequencies +- batman-adv: Avoid infinite loop trying to resize local TT +- ata: libata-scsi: Fix ata_scsi_dev_rescan() error path +- ata: libata-core: Allow command duration limits detection for ACS-4 drives +- smb3: fix Open files on server counter going negative +- drm: Check polling initialized before enabling in drm_helper_probe_single_connector_modes +- Revert "drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init()" +- VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler() +- net: mpls: error out if inner headers are not set +- Bluetooth: btintel: Fixe build regression +- platform/x86: intel-vbtn: Update tablet mode switch at end of probe +- randomize_kstack: Improve entropy diffusion +- media: mediatek: vcodec: adding lock to protect encoder context list +- media: mediatek: vcodec: adding lock to protect decoder context list +- media: mediatek: vcodec: Fix oops when HEVC init fails +- selftests: mptcp: display simult in extra_msg +- gcc-plugins/stackleak: Avoid .head.text section +- ALSA: hda/realtek: Add quirks for some Clevo laptops +- fbmon: prevent division by zero in fb_videomode_from_videomode() +- drivers/nvme: Add quirks for device 126f:2262 +- modpost: fix null pointer dereference +- io_uring: clear opcode specific data for an early failure +- fbdev: viafb: fix typo in hw_bitblt_1 and hw_bitblt_2 +- x86/xen: attempt to inflate the memory balloon on PVH +- ASoC: soc-core.c: Skip dummy codec when adding platforms +- thermal/of: Assume polling-delay(-passive) 0 when absent +- ASoC: amd: yc: Fix non-functional mic on ASUS M7600RE +- usb: sl811-hcd: only defined function checkdone if QUIRK2 is defined +- usb: typec: tcpci: add generic tcpci fallback compatible +- thunderbolt: Keep the domain powered when USB4 port is in redrive mode +- usb: typec: ucsi: Limit read size on v1.2 +- usb: gadget: uvc: mark incomplete frames with UVC_STREAM_ERR +- bus: mhi: host: Add MHI_PM_SYS_ERR_FAIL state +- tools: iio: replace seekdir() in iio_generic_buffer +- ring-buffer: use READ_ONCE() to read cpu_buffer->commit_page in concurrent environment +- Input: xpad - add support for Snakebyte GAMEPADs +- ktest: force $buildonly = 1 for 'make_warnings_file' test type +- ALSA: hda/realtek: Add quirk for Lenovo Yoga 9 14IMH9 +- platform/x86: touchscreen_dmi: Add an extra entry for a variant of the Chuwi Vi8 tablet +- Input: allocate keycode for Display refresh rate toggle +- Input: imagis - use FIELD_GET where applicable +- RDMA/cm: add timeout to cm_destroy_id wait +- block: prevent division by zero in blk_rq_stat_sum() +- input/touchscreen: imagis: Correct the maximum touch area value +- libperf evlist: Avoid out-of-bounds access +- Revert "ACPI: PM: Block ASUS B1400CEAE from suspend to idle by default" +- PCI: Disable D3cold on Asus B1400 PCI-NVMe bridge +- SUNRPC: increase size of rpc_wait_queue.qlen from unsigned short to unsigned int +- drm: Check output polling initialized before disabling +- drm/amd/amdgpu: Fix potential ioremap() memory leaks in amdgpu_device_init() +- HID: input: avoid polling stylus battery on Chromebook Pompom +- i2c: designware: Fix RX FIFO depth define on Wangxun 10Gb NIC +- accel/habanalabs: increase HL_MAX_STR to 64 bytes to avoid warnings +- drm/amd/display: Fix nanosec stat overflow +- ext4: forbid commit inconsistent quota data when errors=remount-ro +- ext4: add a hint for block bitmap corrupt state in mb_groups +- ASoC: Intel: avs: Populate board selection with new I2S entries +- ALSA: firewire-lib: handle quirk to calculate payload quadlets as data block counter +- media: sta2x11: fix irq handler cast +- Julia Lawall reported this null pointer dereference, this should fix it. +- rcu-tasks: Repair RCU Tasks Trace quiescence check +- rcu/nocb: Fix WARN_ON_ONCE() in the rcu_nocb_bypass_lock() +- ASoC: Intel: common: DMI remap for rebranded Intel NUC M15 (LAPRC710) laptops +- isofs: handle CDs with bad root inode but good Joliet root directory +- scsi: lpfc: Fix possible memory leak in lpfc_rcv_padisc() +- sysv: don't call sb_bread() with pointers_lock held +- pinctrl: renesas: checker: Limit cfg reg enum checks to provided IDs +- drm/ttm: return ENOSPC from ttm_bo_mem_space v3 +- ASoC: SOF: amd: Optimize quirk for Valve Galileo +- drm: panel-orientation-quirks: Add quirk for GPD Win Mini +- Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails +- drm/vc4: don't check if plane->state->fb == state->fb +- Bluetooth: Add new quirk for broken read key length on ATS2851 +- Bluetooth: btmtk: Add MODULE_FIRMWARE() for MT7922 +- Bluetooth: btintel: Fix null ptr deref in btintel_read_version +- net/smc: reduce rtnl pressure in smc_pnet_create_pnetids_list() +- ice: use relative VSI index for VFs instead of PF VSI number +- btrfs: send: handle path ref underflow in header iterate_inode_ref() +- btrfs: export: handle invalid inode or root reference in btrfs_get_parent() +- btrfs: handle chunk tree lookup error in btrfs_relocate_sys_chunks() +- wifi: cfg80211: check A-MSDU format more carefully +- wifi: iwlwifi: Add missing MODULE_FIRMWARE() for *.pnvm +- overflow: Allow non-type arg to type_max() and type_min() +- cpufreq: Don't unregister cpufreq cooling on CPU hotplug +- wifi: ath11k: decrease MHI channel buffer length to 8KB +- dma-direct: Leak pages on dma_set_decrypted() failure +- net: pcs: xpcs: Return EINVAL in the internal methods +- tools/power x86_energy_perf_policy: Fix file leak in get_pkg_num() +- pstore/zone: Add a null pointer check to the psz_kmsg_read +- ACPI: x86: Move acpi_quirk_skip_serdev_enumeration() out of CONFIG_X86_ANDROID_TABLETS +- wifi: mt76: mt7996: add locking for accessing mapped registers +- wifi: mt76: mt7996: disable AMSDU for non-data frames +- wifi: mt76: mt7915: add locking for accessing mapped registers +- wifi: brcmfmac: Add DMI nvram filename quirk for ACEPC W5 Pro +- firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename() +- net: skbuff: add overflow debug check to pull/push helpers +- ionic: set adminq irq affinity +- pmdomain: imx8mp-blk-ctrl: imx8mp_blk: Add fdcc clock to hdmimix domain +- pmdomain: ti: Add a null pointer check to the omap_prm_domain_init +- net: add netdev_lockdep_set_classes() to virtual drivers +- arm64: dts: rockchip: fix rk3399 hdmi ports node +- arm64: dts: rockchip: fix rk3328 hdmi ports node +- ARM: dts: rockchip: fix rk322x hdmi ports node +- ARM: dts: rockchip: fix rk3288 hdmi ports node +- cpuidle: Avoid potential overflow in integer multiplication +- panic: Flush kernel log buffer at the end +- printk: For @suppress_panic_printk check for other CPU in panic +- wifi: iwlwifi: pcie: Add the PCI device id for new hardware +- VMCI: Fix memcpy() run-time warning in dg_dispatch_as_host() +- wifi: rtw89: pci: enlarge RX DMA buffer to consider size of RX descriptor +- net: phy: phy_device: Prevent nullptr exceptions on ISR +- net: stmmac: dwmac-starfive: Add support for JH7100 SoC +- bnx2x: Fix firmware version string character counts +- wifi: rtw89: fix null pointer access when abort scan +- wifi: ath9k: fix LNA selection in ath_ant_try_scan() +- amdkfd: use calloc instead of kzalloc to avoid integer overflow +- x86: set SPECTRE_BHI_ON as default +- KVM: x86: Add BHI_NO +- x86/bhi: Mitigate KVM by default +- x86/bhi: Add BHI mitigation knob +- x86/bhi: Enumerate Branch History Injection (BHI) bug +- x86/bhi: Define SPEC_CTRL_BHI_DIS_S +- x86/bhi: Add support for clearing branch history at syscall entry +- x86/syscall: Don't force use of indirect calls for system calls +- x86/bugs: Change commas to semicolons in 'spectre_v2' sysfs file +- x86/boot: Move mem_encrypt= parsing to the decompressor +- x86/efistub: Remap kernel text read-only before dropping NX attribute +- x86/sev: Move early startup code into .head.text section +- x86/sme: Move early SME kernel encryption handling into .head.text +- efi/libstub: Add generic support for parsing mem_encrypt= +- x86/head/64: Move the __head definition to +- bpf: put uprobe link's path and task in release callback +- mptcp: don't account accept() of non-MPC client as fallback to TCP +- mptcp: don't overwrite sock_ops in mptcp_is_tcpsk() +- selftests: mptcp: connect: fix shellcheck warnings +- of: module: prevent NULL pointer dereference in vsnprintf() +- Revert "x86/mpparse: Register APIC address only once" +- drm/i915/gt: Enable only one CCS for compute workload +- drm/i915/gt: Do not generate the command streamer for all the CCS +- drm/i915/gt: Disable HW load balancing for CCS +- smb: client: fix potential UAF in cifs_signal_cifsd_for_reconnect() +- smb: client: fix potential UAF in smb2_is_network_name_deleted() +- smb: client: fix potential UAF in is_valid_oplock_break() +- smb: client: fix potential UAF in smb2_is_valid_lease_break() +- smb: client: fix potential UAF in smb2_is_valid_oplock_break() +- smb: client: fix potential UAF in cifs_dump_full_key() +- smb: client: fix potential UAF in cifs_stats_proc_show() +- smb: client: fix potential UAF in cifs_stats_proc_write() +- smb: client: fix potential UAF in cifs_debug_files_proc_show() +- smb3: retrying on failed server close +- smb: client: serialise cifs_construct_tcon() with cifs_mount_mutex +- smb: client: handle DFS tcons in cifs_construct_tcon() +- riscv: process: Fix kernel gp leakage +- riscv: Fix spurious errors from __get/put_kernel_nofault +- s390/entry: align system call table on 8 bytes +- selftests/mm: include strings.h for ffsl +- mm/secretmem: fix GUP-fast succeeding on secretmem folios +- arm64/ptrace: Use saved floating point state type to determine SVE layout +- perf/x86/intel/ds: Don't clear ->pebs_data_cfg for the last PEBS event +- x86/coco: Require seeding RNG with RDRAND on CoCo systems +- x86/mce: Make sure to grab mce_sysfs_mutex in set_bank() +- x86/mm/pat: fix VM_PAT handling in COW mappings +- of: dynamic: Synchronize of_changeset_destroy() with the devlink removals +- driver core: Introduce device_link_wait_removal() +- io_uring/kbuf: hold io_buffer_list reference over mmap +- io_uring: use private workqueue for exit work +- io_uring/kbuf: protect io_buffer_list teardown with a reference +- io_uring/kbuf: get rid of bl->is_ready +- io_uring/kbuf: get rid of lower BGID lists +- ALSA: hda/realtek: Update Panasonic CF-SZ6 quirk to support headset with microphone +- ALSA: hda/realtek - Fix inactive headset mic jack +- ksmbd: do not set SMB2_GLOBAL_CAP_ENCRYPTION for SMB 3.1.1 +- ksmbd: validate payload size in ipc response +- ksmbd: don't send oplock break if rename fails +- gpio: cdev: fix missed label sanitizing in debounce_setup() +- gpio: cdev: check for NULL labels when sanitizing them for irqs +- x86/retpoline: Add NOENDBR annotation to the SRSO dummy return thunk +- ice: fix typo in assignment +- nfsd: hold a lighter-weight client reference over CB_RECALL_ANY +- riscv: Disable preemption when using patch_map() +- ASoC: SOF: amd: fix for false dsp interrupts +- ata: sata_mv: Fix PCI device ID table declaration compilation warning +- spi: mchp-pci1xxx: Fix a possible null pointer dereference in pci1xxx_spi_probe +- cifs: Fix caching to try to do open O_WRONLY as rdwr on server +- Revert "ALSA: emu10k1: fix synthesizer sample playback position and caching" +- scsi: mylex: Fix sysfs buffer lengths +- ata: sata_sx4: fix pdc20621_get_from_dimm() on 64-bit +- regmap: maple: Fix uninitialized symbol 'ret' warnings +- ASoC: amd: acp: fix for acp_init function error handling +- spi: s3c64xx: Use DMA mode from fifo size +- spi: s3c64xx: determine the fifo depth only once +- spi: s3c64xx: allow full FIFO masks +- spi: s3c64xx: define a magic value +- spi: s3c64xx: remove else after return +- spi: s3c64xx: explicitly include +- spi: s3c64xx: sort headers alphabetically +- spi: s3c64xx: Extract FIFO depth calculation to a dedicated macro +- ASoC: ops: Fix wraparound for mask in snd_soc_get_volsw +- ASoC: rt722-sdca-sdw: fix locking sequence +- ASoC: rt712-sdca-sdw: fix locking sequence +- ASoC: rt711-sdw: fix locking sequence +- ASoC: rt711-sdca: fix locking sequence +- ASoC: rt5682-sdw: fix locking sequence +- drm/prime: Unbreak virtgpu dma-buf export +- nouveau/uvmm: fix addr/range calcs for remap operations +- drm/panfrost: fix power transition timeout warnings +- ALSA: hda: cs35l56: Add ACPI device match tables +- regmap: maple: Fix cache corruption in regcache_maple_drop() +- RISC-V: Update AT_VECTOR_SIZE_ARCH for new AT_MINSIGSTKSZ +- drivers/perf: riscv: Disable PERF_SAMPLE_BRANCH_* while not supported +- ASoC: wm_adsp: Fix missing mutex_lock in wm_adsp_write_ctl() +- 9p: Fix read/write debug statements to report server reply +- fs/pipe: Fix lockdep false-positive in watchqueue pipe_write() +- KVM: SVM: Add support for allowing zero SEV ASIDs +- KVM: SVM: Use unsigned integers when dealing with ASIDs +- net: ravb: Always update error counters +- net: ravb: Always process TX descriptor ring +- net: ravb: Let IP-specific receive function to interrogate descriptors +- e1000e: move force SMBUS from enable ulp function to avoid PHY loss issue +- e1000e: Minor flow correction in e1000_shutdown function +- e1000e: Workaround for sporadic MDI error on Meteor Lake systems +- intel: legacy: field get conversion +- intel: add bit macro includes where needed +- i40e: Remove circular header dependencies and fix headers +- i40e: Split i40e_osdep.h +- i40e: Move memory allocation structures to i40e_alloc.h +- i40e: Simplify memory allocation functions +- virtchnl: Add header dependencies +- i40e: Refactor I40E_MDIO_CLAUSE* macros +- i40e: Remove back pointer from i40e_hw structure +- i40e: Enforce software interrupt during busy-poll exit +- i40e: Remove _t suffix from enum type names +- drm/amd: Flush GFXOFF requests in prepare stage +- drm/amd: Add concept of running prepare_suspend() sequence for IP blocks +- drm/amd: Evict resources during PM ops prepare() callback +- drm/amd/display: Prevent crash when disable stream +- drm/amd/display: Fix DPSTREAM CLK on and off sequence +- usb: typec: ucsi: Fix race between typec_switch and role_switch +- i40e: fix vf may be used uninitialized in this function warning +- i40e: fix i40e_count_filters() to count only active/new filters +- octeontx2-af: Add array index check +- octeontx2-pf: check negative error code in otx2_open() +- octeontx2-af: Fix issue with loading coalesced KPU profiles +- udp: prevent local UDP tunnel packets from being GROed +- udp: do not transition UDP GRO fraglist partial checksums to unnecessary +- udp: do not accept non-tunnel GSO skbs landing in a tunnel +- r8169: skip DASH fw status checks when DASH is disabled +- mlxbf_gige: stop interface during shutdown +- ipv6: Fix infinite recursion in fib6_dump_done(). +- ax25: fix use-after-free bugs caused by ax25_ds_del_timer +- tcp: Fix bind() regression for v6-only wildcard and v4(-mapped-v6) non-wildcard addresses. +- selftests: reuseaddr_conflict: add missing new line at the end of the output +- erspan: make sure erspan_base_hdr is present in skb->head +- i40e: Fix VF MAC filter removal +- ice: fix enabling RX VLAN filtering +- gro: fix ownership transfer +- selftests: net: gro fwd: update vxlan GRO test expectations +- net: dsa: mv88e6xxx: fix usable ports on 88e6020 +- net: phy: micrel: Fix potential null pointer dereference +- net: fec: Set mac_managed_pm during probe +- net: txgbe: fix i2c dev name cannot match clkdev +- net: phy: micrel: lan8814: Fix when enabling/disabling 1-step timestamping +- net: stmmac: fix rx queue priority assignment +- net/sched: fix lockdep splat in qdisc_tree_reduce_backlog() +- net: dsa: sja1105: Fix parameters order in sja1110_pcs_mdio_write_c45() +- net/sched: act_skbmod: prevent kernel-infoleak +- KVM: arm64: Ensure target address is granule-aligned for range TLBI +- x86/retpoline: Do the necessary fixup to the Zen3/4 srso return thunk for !SRSO +- bpf, sockmap: Prevent lock inversion deadlock in map delete elem +- vboxsf: Avoid an spurious warning if load_nls_xxx() fails +- netfilter: validate user input for expected length +- netfilter: nf_tables: discard table flag update with pending basechain deletion +- netfilter: nf_tables: Fix potential data-race in __nft_flowtable_type_get() +- netfilter: nf_tables: flush pending destroy work before exit_net release +- netfilter: nf_tables: reject new basechain after table flag update +- x86/bugs: Fix the SRSO mitigation on Zen3/4 +- x86/nospec: Refactor UNTRAIN_RET[_*] +- x86/srso: Disentangle rethunk-dependent options +- x86/srso: Improve i-cache locality for alias mitigation +- vsock/virtio: fix packet delivery to tap device +- net: mana: Fix Rx DMA datasize and skb_over_panic +- net: usb: ax88179_178a: avoid the interface always configured as random address +- net/rds: fix possible cp null dereference +- xen-netfront: Add missing skb_mark_for_recycle +- selftests: mptcp: join: fix dev in check_endpoint +- netfilter: nf_tables: release mutex after nft_gc_seq_end from abort path +- netfilter: nf_tables: release batch on table validation from abort path +- Bluetooth: Fix TOCTOU in HCI debugfs implementation +- Bluetooth: hci_event: set the conn encrypted before conn establishes +- Bluetooth: add quirk for broken address properties +- Bluetooth: qca: fix device-address endianness +- arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken +- Revert "Bluetooth: hci_qca: Set BDA quirk bit if fwnode exists in DT" +- x86/bpf: Fix IP after emitting call depth accounting +- r8169: fix issue caused by buggy BIOS on certain boards with RTL8168d +- selinux: avoid dereference of garbage after mount failure +- KVM: arm64: Fix host-programmed guest events in nVHE +- RISC-V: KVM: Fix APLIC in_clrip[x] read emulation +- RISC-V: KVM: Fix APLIC setipnum_le/be write emulation +- gpio: cdev: sanitize the label before requesting the interrupt +- modpost: do not make find_tosym() return NULL +- btrfs: fix race when detecting delalloc ranges during fiemap +- btrfs: ensure fiemap doesn't race with writes when FIEMAP_FLAG_SYNC is given +- Revert "x86/mm/ident_map: Use gbpages only where full GB page should be mapped." +- mm/treewide: replace pud_large() with pud_leaf() +- dm integrity: fix out-of-range warning +- drm/i915/mtl: Update workaround 14018575942 +- drm/i915/xelpg: Extend some workarounds/tuning to gfx version 12.74 +- drm/i915/mtl: Update workaround 14016712196 +- drm/i915: Replace several IS_METEORLAKE with proper IP version checks +- drm/i915: Eliminate IS_MTL_GRAPHICS_STEP +- drm/i915/xelpg: Call Xe_LPG workaround functions based on IP version +- drm/i915: Consolidate condition for Wa_22011802037 +- drm/i915: Tidy workaround definitions +- drm/i915/dg2: Drop pre-production GT workarounds +- inet: inet_defrag: prevent sk release while still in use +- Octeontx2-af: fix pause frame configuration in GMP mode +- net: lan743x: Add set RFE read fifo threshold for PCI1x1x chips +- net: bcmasp: Bring up unimac after PHY link up +- netfilter: nf_tables: skip netdev hook unregistration if table is dormant +- netfilter: nf_tables: reject table flag and netdev basechain updates +- netfilter: nf_tables: reject destroy command to remove basechain hooks +- cifs: Fix duplicate fscache cookie warnings +- bpf: Protect against int overflow for stack access size +- mlxbf_gige: call request_irq() after NAPI initialized +- tls: get psock ref after taking rxlock to avoid leak +- tls: adjust recv return with async crypto and failed copy to userspace +- tls: recv: process_rx_list shouldn't use an offset with kvec +- net: hns3: mark unexcuted loopback test result as UNEXECUTED +- net: hns3: fix kernel crash when devlink reload during pf initialization +- net: hns3: fix index limit to support all queue stats +- ACPICA: debugger: check status of acpi_evaluate_object() in acpi_db_walk_for_fields() +- selftests: vxlan_mdb: Fix failures with old libnet +- net: wwan: t7xx: Split 64bit accesses to fix alignment issues +- tcp: properly terminate timers for kernel sockets +- net: hsr: hsr_slave: Fix the promiscuous mode in offload mode +- s390/qeth: handle deferred cc1 +- igc: Remove stale comment about Tx timestamping +- ixgbe: avoid sleeping allocation in ixgbe_ipsec_vf_add_sa() +- ice: fix memory corruption bug with suspend and rebuild +- ice: realloc VSI stats arrays +- ice: Refactor FW data type and fix bitmap casting issue +- ALSA: hda: cs35l56: Set the init_done flag before component_add() +- wifi: iwlwifi: mvm: include link ID when releasing frames +- wifi: iwlwifi: disable multi rx queue for 9000 +- wifi: iwlwifi: mvm: rfi: fix potential response leaks +- mlxbf_gige: stop PHY during open() error paths +- tools: ynl: fix setting presence bits in simple nests +- nfc: nci: Fix uninit-value in nci_dev_up and nci_ntf_packet +- arm64: bpf: fix 32bit unconditional bswap +- dma-buf: Fix NULL pointer dereference in sanitycheck() +- bpf, arm64: fix bug in BPF_LDX_MEMSX +- s390/bpf: Fix bpf_plt pointer arithmetic +- scripts/bpf_doc: Use silent mode when exec make cmd +- drm/i915: Pre-populate the cursor physical dma address +- drm/i915/display: Use i915_gem_object_get_dma_address to get dma address +- Revert "workqueue.c: Increase workqueue name length" +- Revert "workqueue: Move pwq->max_active to wq->max_active" +- Revert "workqueue: Factor out pwq_is_empty()" +- Revert "workqueue: Replace pwq_activate_inactive_work() with [__]pwq_activate_work()" +- Revert "workqueue: Move nr_active handling into helpers" +- Revert "workqueue: Make wq_adjust_max_active() round-robin pwqs while activating" +- Revert "workqueue: Introduce struct wq_node_nr_active" +- Revert "workqueue: Shorten events_freezable_power_efficient name" +- drm/amdgpu: fix use-after-free bug +- tools/resolve_btfids: fix build with musl libc +- x86/sev: Skip ROM range scans and validation for SEV-SNP guests +- scsi: lpfc: Correct size for wqe for memset() +- scsi: lpfc: Correct size for cmdwqe/rspwqe for memset() +- usb: dwc3: pci: Drop duplicate ID +- Revert "x86/bugs: Use fixed addressing for VERW operand" +- x86/bugs: Use fixed addressing for VERW operand +- scsi: qla2xxx: Delay I/O Abort on PCI error +- scsi: qla2xxx: Change debug message during driver unload +- scsi: qla2xxx: Fix double free of fcport +- scsi: qla2xxx: Fix double free of the ha->vp_map pointer +- scsi: qla2xxx: Fix command flush on cable pull +- scsi: qla2xxx: NVME|FCP prefer flag not being honored +- scsi: qla2xxx: Update manufacturer detail +- scsi: qla2xxx: Split FCE|EFT trace control +- scsi: qla2xxx: Fix N2N stuck connection +- scsi: qla2xxx: Prevent command send on chip reset +- usb: typec: ucsi: Clear UCSI_CCI_RESET_COMPLETE before reset +- usb: typec: ucsi_acpi: Refactor and fix DELL quirk +- usb: typec: ucsi: Ack unsupported commands +- usb: typec: ucsi: Clear EVENT_PENDING under PPM lock +- usb: typec: Return size of buffer if pd_set operation succeeds +- usb: udc: remove warning when queue disabled ep +- usb: dwc2: gadget: LPM flow fix +- usb: dwc2: gadget: Fix exiting from clock gating +- usb: dwc2: host: Fix ISOC flow in DDMA mode +- usb: dwc2: host: Fix hibernation flow +- usb: dwc2: host: Fix remote wakeup from hibernation +- USB: core: Fix deadlock in port "disable" sysfs attribute +- USB: core: Add hub_get() and hub_put() routines +- USB: core: Fix deadlock in usb_deauthorize_interface() +- usb: dwc3: Properly set system wakeup +- staging: vc04_services: fix information leak in create_component() +- staging: vc04_services: changen strncpy() to strscpy_pad() +- scsi: core: Fix unremoved procfs host directory regression +- scsi: sd: Fix TCG OPAL unlock on system resume +- vfio/pds: Make sure migration file isn't accessed after reset +- drm/amd/display: Clear OPTC mem select on disable +- drm/amd/display: Disconnect phantom pipe OPP from OPTC being disabled +- drm/amd/display: Fix hang/underflow when transitioning to ODM4:1 +- USB: UAS: return ENODEV when submit urbs fail with device not attached +- usb: cdc-wdm: close race between read and workqueue +- Revert "usb: phy: generic: Get the vbus supply" +- mtd: spinand: Add support for 5-byte IDs +- Bluetooth: hci_sync: Fix not checking error on hci_cmd_sync_cancel_sync +- drm/i915/gt: Reset queue_priority_hint on parking +- drm/i915: Do not match JSL in ehl_combo_pll_div_frac_wa_needed() +- drm/i915/dsi: Go back to the previous INIT_OTP/DISPLAY_ON order, mostly +- drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode() +- drm/i915/hwmon: Fix locking inversion in sysfs getter +- drm/amdgpu: fix deadlock while reading mqd from debugfs +- drm/amdkfd: fix TLB flush after unmap for GFX9.4.2 +- drm/vmwgfx: Create debugfs ttm_resource_manager entry only if needed +- net: ll_temac: platform_get_resource replaced by wrong function +- nouveau/dmem: handle kcalloc() allocation failure +- thermal: devfreq_cooling: Fix perf state when calculate dfc res_util +- block: Do not force full zone append completion in req_bio_endio() +- sdhci-of-dwcmshc: disable PM runtime in dwcmshc_remove() +- mmc: core: Avoid negative index with array access +- mmc: core: Initialize mmc_blk_ioc_data +- mmc: sdhci-omap: re-tuning is needed after a pm transition to support emmc HS200 mode +- selftests/mm: fix ARM related issue with fork after pthread_create +- selftests/mm: sigbus-wp test requires UFFD_FEATURE_WP_HUGETLBFS_SHMEM +- mm: cachestat: fix two shmem bugs +- hexagon: vmlinux.lds.S: handle attributes section +- exec: Fix NOMMU linux_binprm::exec in transfer_args_to_stack() +- Revert "drm/amd/display: Fix sending VSC (+ colorimetry) packets for DP/eDP displays without PSR" +- wifi: iwlwifi: fw: don't always use FW dump trig +- wifi: iwlwifi: mvm: disable MLO for the time being +- wifi: cfg80211: add a flag to disable wireless extensions +- wifi: mac80211: check/clear fast rx for non-4addr sta VLAN changes +- btrfs: zoned: use zone aware sb location for scrub +- btrfs: zoned: don't skip block groups with 100% zone unusable +- btrfs: fix race in read_extent_buffer_pages() +- tmpfs: fix race on handling dquot rbtree +- ARM: prctl: reject PR_SET_MDWE on pre-ARMv6 +- prctl: generalize PR_SET_MDWE support check to be per-arch +- x86/efistub: Reinstate soft limit for initrd loading +- x86/efistub: Add missing boot_params for mixed mode compat entry +- init: open /initrd.image with O_LARGEFILE +- ALSA: hda/tas2781: add locks to kcontrols +- ALSA: hda/tas2781: remove digital gain kcontrol +- perf top: Use evsel's cpus to replace user_requested_cpus +- selftests/mm: Fix build with _FORTIFY_SOURCE +- selftests/mm: gup_test: conform test to TAP format output +- pwm: img: fix pwm clock lookup +- efi: fix panic in kdump kernel +- x86/fpu: Keep xfd_state in sync with MSR_IA32_XFD +- x86/mpparse: Register APIC address only once +- kprobes/x86: Use copy_from_kernel_nofault() to read from unsafe address +- irqchip/renesas-rzg2l: Prevent spurious interrupts when setting trigger type +- irqchip/renesas-rzg2l: Rename rzg2l_irq_eoi() +- irqchip/renesas-rzg2l: Rename rzg2l_tint_eoi() +- irqchip/renesas-rzg2l: Add macro to retrieve TITSR register offset based on register's index +- irqchip/renesas-rzg2l: Flush posted write in irq_eoi() +- irqchip/renesas-rzg2l: Implement restriction when writing ISCR register +- printk: Update @console_may_schedule in console_trylock_spinning() +- iommu/dma: Force swiotlb_max_mapping_size on an untrusted device +- swiotlb: Fix alignment checks when both allocation and DMA masks are present +- swiotlb: Honour dma_alloc_coherent() alignment in swiotlb_alloc() +- swiotlb: Fix double-allocation of slots due to broken alignment handling +- entry: Respect changes to system call number by trace_sys_enter() +- ARM: 9359/1: flush: check if the folio is reserved for no-mapping addresses +- ARM: 9352/1: iwmmxt: Remove support for PJ4/PJ4B cores +- clocksource/drivers/arm_global_timer: Fix maximum prescaler value +- x86/sev: Fix position dependent variable references in startup code +- x86/Kconfig: Remove CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT +- vfio/fsl-mc: Block calling interrupt handler without trigger +- vfio/platform: Create persistent IRQ handlers +- vfio/pci: Create persistent INTx handler +- vfio: Introduce interface to flush virqfd inject workqueue +- btrfs: fix deadlock with fiemap and extent locking +- xfs: remove conditional building of rt geometry validator functions +- xfs: reset XFS_ATTR_INCOMPLETE filter on node removal +- xfs: update dir3 leaf block metadata after swap +- xfs: ensure logflagsp is initialized in xfs_bmap_del_extent_real +- xfs: short circuit xfs_growfs_data_private() if delta is zero +- xfs: initialise di_crc in xfs_log_dinode +- xfs: add missing nrext64 inode flag check to scrub +- xfs: force all buffers to be written during btree bulk load +- xfs: fix an off-by-one error in xreap_agextent_binval +- xfs: recompute growfsrtfree transaction reservation while growing rt volume +- xfs: remove unused fields from struct xbtree_ifakeroot +- xfs: make xchk_iget safer in the presence of corrupt inode btrees +- xfs: don't allow overly small or large realtime volumes +- xfs: fix 32-bit truncation in xfs_compute_rextslog +- xfs: make rextslog computation consistent with mkfs +- xfs: transfer recovered intent item ownership in ->iop_recover +- xfs: pass the xfs_defer_pending object to iop_recover +- xfs: use xfs_defer_pending objects to recover intent items +- xfs: don't leak recovered attri intent items +- xfs: consider minlen sized extents in xfs_rtallocate_extent_block +- xfs: convert rt bitmap extent lengths to xfs_rtbxlen_t +- xfs: move the xfs_rtbitmap.c declarations to xfs_rtbitmap.h +- wifi: rtw88: 8821cu: Fix connection failure +- wifi: iwlwifi: pcie: fix RB status reading +- ASoC: amd: yc: Revert "Fix non-functional mic on Lenovo 21J2" +- x86/efistub: Call mixed mode boot services on the firmware's stack +- drm/amd/display: handle range offsets in VRR ranges +- drm/i915: Don't explode when the dig port we don't have an AUX CH +- iio: imu: inv_mpu6050: fix FIFO parsing when empty +- iio: imu: inv_mpu6050: fix frequency setting when chip is off +- i2c: i801: Avoid potential double call to gpiod_remove_lookup_table +- iio: accel: adxl367: fix I2C FIFO data register +- iio: accel: adxl367: fix DEVID read after reset +- arm64: dts: qcom: sc8280xp-x13s: limit pcie4 link speed +- mm, vmscan: prevent infinite loop for costly GFP_NOIO | __GFP_RETRY_MAYFAIL allocations +- ARM: imx_v6_v7_defconfig: Restore CONFIG_BACKLIGHT_CLASS_DEVICE +- tee: optee: Fix kernel panic caused by incorrect error handling +- ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook +- ALSA: hda/realtek - Add Headset Mic supported Acer NB platform +- fs/aio: Check IOCB_AIO_RW before the struct aio_kiocb conversion +- Revert "tty: serial: simplify qcom_geni_serial_send_chunk_fifo()" +- vt: fix unicode buffer corruption when deleting characters +- mei: me: add arrow lake point H DID +- mei: me: add arrow lake point S DID +- serial: port: Don't suspend if the port is still busy +- misc: fastrpc: Pass proper arguments to scm call +- misc: lis3lv02d_i2c: Fix regulators getting en-/dis-abled twice on suspend/resume +- tty: serial: fsl_lpuart: avoid idle preamble pending if CTS is enabled +- xhci: Fix failure to detect ring expansion need. +- usb: port: Don't try to peer unused USB ports based on location +- usb: gadget: ncm: Fix handling of zero block length packets +- usb: typec: altmodes/displayport: create sysfs nodes as driver's default device attribute group +- USB: usb-storage: Prevent divide-by-0 error in isd200_ata_command +- ALSA: hda/realtek - Fix headset Mic no show at resume back for Lenovo ALC897 platform +- drm/i915: Check before removing mm notifier +- tty: serial: imx: Fix broken RS485 +- drm/amdgpu/pm: Fix the error of pwm1_enable setting +- tracing: Use .flush() call to wake up readers +- SEV: disable SEV-ES DebugSwap by default +- KVM: SVM: Flush pages under kvm->lock to fix UAF in svm_register_enc_region() +- KVM: x86: Mark target gfn of emulated atomic instruction as dirty +- firewire: ohci: prevent leak of left-over IRQ on unbind +- init/Kconfig: lower GCC version check for -Warray-bounds +- Input: xpad - add additional HyperX Controller Identifiers +- cgroup/cpuset: Fix retval in update_cpumask() +- usb: typec: tpcm: Fix PORT_RESET behavior for self powered devices +- selftests: mptcp: diag: return KSFT_FAIL not test_cnt +- mm, mmap: fix vma_merge() case 7 with vma_ops->close +- xfrm: Avoid clang fortify warning in copy_to_user_tmpl() +- crypto: sun8i-ce - Fix use after free in unprepare +- crypto: rk3288 - Fix use after free in unprepare +- drm/nouveau: fix stale locked mutex in nouveau_gem_ioctl_pushbuf +- nouveau: lock the client object tree. +- Drivers: hv: vmbus: Calculate ring buffer size for more efficient use of memory +- netfilter: nf_tables: reject constant set with timeout +- netfilter: nf_tables: disallow anonymous set with timeout flag +- netfilter: nf_tables: mark set as dead when unbinding anonymous set with timeout +- net: fix IPSTATS_MIB_OUTPKGS increment in OutForwDatagrams. +- drm/amd/display: Use freesync when `DRM_EDID_FEATURE_CONTINUOUS_FREQ` found +- workqueue: Shorten events_freezable_power_efficient name +- drm/bridge: lt8912b: do not return negative values from .get_modes() +- drm/bridge: lt8912b: clear the EDID property on failures +- drm/bridge: lt8912b: use drm_bridge_edid_read() +- drm/bridge: add ->edid_read hook and drm_bridge_edid_read() +- drm/ttm: Make sure the mapped tt pages are decrypted when needed +- wifi: brcmfmac: Demote vendor-specific attach/detach messages to info +- wifi: brcmfmac: cfg80211: Use WSEC to set SAE password +- wifi: brcmfmac: add per-vendor feature detection callback +- x86/pm: Work around false positive kmemleak report in msr_build_context() +- dm snapshot: fix lockup in dm_exception_table_exit +- drm/amd/display: Fix noise issue on HDMI AV mute +- drm/amd/display: Return the correct HDCP error code +- drm/amdgpu: amdgpu_ttm_gart_bind set gtt bound flag +- ahci: asm1064: asm1166: don't limit reported ports +- ahci: asm1064: correct count of reported ports +- wireguard: selftests: set RISCV_ISA_FALLBACK on riscv{32,64} +- wireguard: netlink: access device through ctx instead of peer +- wireguard: netlink: check for dangling peer via is_dead instead of empty list +- LoongArch/crypto: Clean up useless assignment operations +- LoongArch: Define the __io_aw() hook as mmiowb() +- LoongArch: Change __my_cpu_offset definition to avoid mis-optimization +- virtio: reenable config if freezing device failed +- cxl/trace: Properly initialize cxl_poison region name +- net: hns3: tracing: fix hclgevf trace event strings +- drm/i915: Add missing ; to __assign_str() macros in tracepoint code +- NFSD: Fix nfsd_clid_class use of __string_len() macro +- net: esp: fix bad handling of pages from page_pool +- x86/CPU/AMD: Update the Zenbleed microcode revisions +- cpufreq: dt: always allocate zeroed cpumask +- mtd: rawnand: Constrain even more when continuous reads are enabled +- mtd: rawnand: Fix and simplify again the continuous read derivations +- cifs: open_cached_dir(): add FILE_READ_EA to desired access +- cifs: reduce warning log level for server not advertising interfaces +- cifs: make cifs_chan_update_iface() a void function +- cifs: delete unnecessary NULL checks in cifs_chan_update_iface() +- cifs: do not let cifs_chan_update_iface deallocate channels +- cifs: make sure server interfaces are requested only for SMB3+ +- cifs: add xid to query server interface call +- nilfs2: prevent kernel bug at submit_bh_wbc() +- nilfs2: fix failure to detect DAT corruption in btree and direct mappings +- f2fs: truncate page cache before clearing flags when aborting atomic write +- f2fs: mark inode dirty for FI_ATOMIC_COMMITTED flag +- Revert "block/mq-deadline: use correct way to throttling write requests" +- memtest: use {READ,WRITE}_ONCE in memory scanning +- drm/vc4: hdmi: do not return negative values from .get_modes() +- drm/imx/ipuv3: do not return negative values from .get_modes() +- drm/exynos: do not return negative values from .get_modes() +- drm/panel: do not return negative error codes from drm_panel_get_modes() +- drm/probe-helper: warn about negative .get_modes() +- s390/zcrypt: fix reference counting on zcrypt card objects +- soc: fsl: qbman: Use raw spinlock for cgr_lock +- soc: fsl: qbman: Always disable interrupts when taking cgr_lock +- dlm: fix user space lkb refcounting +- ring-buffer: Use wait_event_interruptible() in ring_buffer_wait() +- ring-buffer: Fix full_waiters_pending in poll +- ring-buffer: Fix resetting of shortest_full +- ring-buffer: Do not set shortest_full when full target is hit +- ring-buffer: Fix waking up ring buffer readers +- io_uring: clean rings on NO_MMAP alloc fail +- platform/x86/intel/tpmi: Change vsec offset to u64 +- ksmbd: retrieve number of blocks using vfs_getattr in set_file_allocation_info +- ksmbd: replace generic_fillattr with vfs_getattr +- server: convert to new timestamp accessors +- vfio/platform: Disable virqfds on cleanup +- vfio/pci: Lock external INTx masking ops +- vfio/pci: Disable auto-enable of exclusive INTx IRQ +- thermal/drivers/mediatek: Fix control buffer enablement on MT7896 +- cifs: allow changing password during remount +- cifs: prevent updating file size from server if we have a read/write lease +- smb: client: stop revalidating reparse points unnecessarily +- PCI: hv: Fix ring buffer size calculation +- PCI: dwc: endpoint: Fix advertised resizable BAR size +- PCI: qcom: Enable BDF to SID translation properly +- kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1 +- NFS: Read unlock folio on nfs_page_create_from_folio() error +- nfs: fix UAF in direct writes +- sparc32: Fix parport build with sparc32 +- io_uring: fix mshot io-wq checks +- io_uring/net: correctly handle multishot recvmsg retry setup +- PCI/AER: Block runtime suspend when handling errors +- speakup: Fix 8bit characters from direct synth +- usb: gadget: tegra-xudc: Fix USB3 PHY retrieval logic +- phy: tegra: xusb: Add API to retrieve the port number of phy +- slimbus: core: Remove usage of the deprecated ida_simple_xx() API +- nvmem: meson-efuse: fix function pointer type mismatch +- ext4: fix corruption during on-line resize +- hwmon: (amc6821) add of_match table +- landlock: Warn once if a Landlock action is requested while disabled +- drm/etnaviv: Restore some id values +- leds: trigger: netdev: Fix kernel panic on interface rename trig notify +- Bluetooth: btnxpuart: Fix btnxpuart_close +- mmc: core: Fix switch on gp3 partition +- mm: swap: fix race between free_swap_and_cache() and swapoff() +- mac802154: fix llsec key resources release in mac802154_llsec_key_del +- block: Fix page refcounts for unaligned buffers in __bio_release_pages() +- powerpc: xor_vmx: Add '-mhard-float' to CFLAGS +- dm-raid: fix lockdep waring in "pers->hot_add_disk" +- PCI/DPC: Quirk PIO log size for Intel Raptor Lake Root Ports +- PCI/PM: Drain runtime-idle callbacks before driver removal +- wifi: rtw88: Add missing VID/PIDs for 8811CU and 8821CU +- btrfs: fix off-by-one chunk length calculation at contains_pending_extent() +- btrfs: qgroup: always free reserved space for extent records +- serial: Lock console when calling into driver before registration +- serial: core: only stop transmit when HW fifo is empty +- usb: dwc3-am62: Disable wakeup at remove +- usb: dwc3-am62: fix module unload/reload behavior +- usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros +- fuse: don't unhash root +- fuse: fix root lookup with nonzero generation +- fuse: replace remaining make_bad_inode() with fuse_make_bad() +- mmc: tmio: avoid concurrent runs of mmc_request_done() +- PM: sleep: wakeirq: fix wake irq warning in system suspend +- USB: serial: cp210x: add pid/vid for TDK NC0110013M and MM0110113M +- KVM: x86/xen: inject vCPU upcall vector when local APIC is enabled +- USB: serial: option: add MeiG Smart SLM320 product +- USB: serial: cp210x: add ID for MGP Instruments PDS100 +- USB: serial: add device ID for VeriFone adapter +- USB: serial: ftdi_sio: add support for GMC Z216C Adapter IR-USB +- powerpc/fsl: Fix mfpmr build errors with newer binutils +- usb: xhci: Add error handling in xhci_map_urb_for_dma +- clk: qcom: mmcc-msm8974: fix terminating of frequency table arrays +- clk: qcom: mmcc-apq8084: fix terminating of frequency table arrays +- clk: qcom: gcc-ipq9574: fix terminating of frequency table arrays +- clk: qcom: gcc-ipq8074: fix terminating of frequency table arrays +- clk: qcom: gcc-ipq6018: fix terminating of frequency table arrays +- clk: qcom: gcc-ipq5018: fix terminating of frequency table arrays +- vfio/pds: Always clear the save/restore FDs on reset +- PM: suspend: Set mem_sleep_current during kernel command line setup +- cpufreq: Limit resolving a frequency to policy min/max +- docs: Restore "smart quotes" for quotes +- iio: adc: rockchip_saradc: use mask for write_enable bitfield +- iio: adc: rockchip_saradc: fix bitmask for channels on SARADCv2 +- md/raid5: fix atomicity violation in raid5_cache_count +- parisc: Strip upper 32 bit of sum in csum_ipv6_magic for 64-bit builds +- parisc: Fix csum_ipv6_magic on 64-bit systems +- parisc: Fix csum_ipv6_magic on 32-bit systems +- parisc: Fix ip_fast_csum +- parisc: Avoid clobbering the C/B bits in the PSW with tophys and tovirt macros +- parisc/unaligned: Rewrite 64-bit inline assembly of emulate_ldd() +- x86/nmi: Fix the inverse "in NMI handler" check +- md/md-bitmap: fix incorrect usage for sb_index +- mtd: rawnand: meson: fix scrambling mode value in command macro +- ubi: correct the calculation of fastmap size +- ubifs: Set page uptodate in the correct place +- fuse: fix VM_MAYSHARE and direct_io_allow_mmap +- fat: fix uninitialized field in nostale filehandles +- bounds: support non-power-of-two CONFIG_NR_CPUS +- kasan/test: avoid gcc warning for intentional overflow +- block: Clear zone limits for a non-zoned stacked queue +- ext4: correct best extent lstart adjustment logic +- selftests/mqueue: Set timeout to 180 seconds +- sparc: vDSO: fix return value of __setup handler +- sparc64: NMI watchdog: fix return value of __setup handler +- powerpc/smp: Increase nr_cpu_ids to include the boot CPU +- powerpc/smp: Adjust nr_cpu_ids to cover all threads of a core +- powercap: intel_rapl_tpmi: Fix System Domain probing +- powercap: intel_rapl_tpmi: Fix a register bug +- powercap: intel_rapl: Fix locking in TPMI RAPL +- sched: Simplify tg_set_cfs_bandwidth() +- powercap: intel_rapl: Fix a NULL pointer dereference +- thermal/intel: Fix intel_tcc_get_temp() to support negative CPU temperature +- cpufreq: amd-pstate: Fix min_perf assignment in amd_pstate_adjust_perf() +- arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping +- arm64: dts: qcom: sm8550-qrd: correct WCD9385 TX port mapping +- KVM: Always flush async #PF workqueue when vCPU is being destroyed +- media: nxp: imx8-isi: Mark all crossbar sink pads as MUST_CONNECT +- media: mc: Expand MUST_CONNECT flag to always require an enabled link +- media: mc: Rename pad variable to clarify intent +- media: mc: Add num_links flag to media_pad +- media: nxp: imx8-isi: Check whether crossbar pad is non-NULL before access +- media: mc: Fix flags handling when creating pad links +- media: mc: Add local pad to pipeline regardless of the link state +- media: xc4000: Fix atomicity violation in xc4000_get_frequency +- pci_iounmap(): Fix MMIO mapping leak +- drm/vmwgfx: Fix the lifetime of the bo cursor memory +- serial: max310x: fix NULL pointer dereference in I2C instantiation +- drm/vmwgfx: Fix possible null pointer derefence with invalid contexts +- arm: dts: marvell: Fix maxium->maxim typo in brownstone dts +- smack: Handle SMACK64TRANSMUTE in smack_inode_setsecurity() +- smack: Set SMACK64TRANSMUTE only for dirs in smack_inode_setxattr() +- clk: qcom: gcc-sdm845: Add soft dependency on rpmhpd +- remoteproc: virtio: Fix wdg cannot recovery remote processor +- arm64: dts: qcom: sc7280: Add additional MSI interrupts +- media: staging: ipu3-imgu: Set fields before media_entity_pads_init() +- wifi: brcmfmac: avoid invalid list operation when vendor attach fails +- wifi: brcmfmac: Fix use-after-free bug in brcmf_cfg80211_detach +- drm/vmwgfx: Unmap the surface before resetting it on a plane state +- KVM: x86: Use a switch statement and macros in __feature_translate() +- KVM: x86: Advertise CPUID.(EAX=7,ECX=2):EDX[5:0] to userspace +- x86/efistub: Don't clear BSS twice in mixed mode +- x86/efistub: Clear decompressor BSS in native EFI entrypoint +- dm-integrity: align the outgoing bio in integrity_recheck +- dm io: Support IO priority +- selftests: forwarding: Fix ping failure due to short timeout +- spi: spi-mt65xx: Fix NULL pointer access in interrupt handler +- netfilter: nf_tables: Fix a memory leak in nf_tables_updchain +- net: dsa: mt7530: fix handling of all link-local frames +- net: dsa: mt7530: fix link-local frames that ingress vlan filtering ports +- bpf: report RCU QS in cpumap kthread +- net: report RCU QS on threaded NAPI repolling +- rcu: add a helper to report consolidated flavor QS +- netfilter: nf_tables: do not compare internal table flags on updates +- netfilter: nft_set_pipapo: release elements in clone only from destroy path +- octeontx2-af: Use separate handlers for interrupts +- octeontx2-pf: Send UP messages to VF only when VF is up. +- octeontx2-pf: Use default max_active works instead of one +- octeontx2-pf: Wait till detach_resources msg is complete +- octeontx2: Detect the mbox up or down message via register +- devlink: fix port new reply cmd type +- net/bnx2x: Prevent access to a freed page in page_pool +- dm-integrity: fix a memory leak when rechecking the data +- net: phy: fix phy_read_poll_timeout argument type in genphy_loopback +- ceph: stop copying to iter at EOF on sync reads +- ipv4: raw: Fix sending packets from raw sockets via IPsec tunnels +- hsr: Handle failures in module init +- rds: introduce acquire/release ordering in acquire/release_in_xmit() +- wireguard: receive: annotate data-race around receiving_counter.counter +- virtio: packed: fix unmap leak for indirect desc table +- vdpa/mlx5: Allow CVQ size changes +- vdpa_sim: reset must not run +- drm: Fix drm_fixp2int_round() making it add 0.5 +- spi: spi-imx: fix off-by-one in mx51 CPU mode burst length +- net: dsa: mt7530: prevent possible incorrect XTAL frequency selection +- net: veth: do not manipulate GRO when using XDP +- xfrm: Allow UDP encapsulation only in offload modes +- packet: annotate data-races around ignore_outgoing +- xen/events: increment refcnt only if event channel is refcounted +- xen/evtchn: avoid WARN() when unbinding an event channel +- riscv: Fix compilation error with FAST_GUP and rv32 +- io_uring: fix poll_remove stalled req completion +- net: ethernet: mtk_eth_soc: fix PPE hanging issue +- net: mediatek: mtk_eth_soc: clear MAC_MCR_FORCE_LINK only when MAC is up +- nvme: fix reconnection fail due to reserved tag allocation +- net: txgbe: fix clk_name exceed MAX_DEV_ID limits +- hsr: Fix uninit-value access in hsr_get_node() +- vmxnet3: Fix missing reserved tailroom +- tcp: Fix refcnt handling in __inet_hash_connect(). +- io_uring: Fix release of pinned pages when __io_uaddr_map fails +- cpufreq: Fix per-policy boost behavior on SoCs using cpufreq_boost_set_sw() +- soc: fsl: dpio: fix kcalloc() argument order +- net/sched: taprio: proper TCA_TAPRIO_TC_ENTRY_INDEX check +- s390/vtime: fix average steal time calculation +- octeontx2-af: Use matching wake_up API variant in CGX command interface +- rds: tcp: Fix use-after-free of net in reqsk_timer_handler(). +- tcp: Fix NEW_SYN_RECV handling in inet_twsk_purge() +- nouveau: reset the bo resource bus info after an eviction +- ASoC: rockchip: i2s-tdm: Fix inaccurate sampling rates +- spi: lpspi: Avoid potential use-after-free in probe() +- io_uring: don't save/restore iowait state +- thermal/drivers/qoriq: Fix getting tmu range +- thermal/drivers/mediatek/lvts_thermal: Fix a memory leak in an error handling path +- ASoC: tlv320adc3xxx: Don't strip remove function when driver is builtin +- x86/hyperv: Use per cpu initial stack for vtl context +- usb: gadget: net2272: Use irqflags in the call to net2272_probe_fin +- staging: greybus: fix get_channel_from_mode() failure path +- serial: 8250_exar: Don't remove GPIO device on suspend +- rtc: mt6397: select IRQ_DOMAIN instead of depending on it +- bus: mhi: ep: check the correct variable in mhi_ep_register_controller() +- iio: gts-helper: Fix division loop +- kconfig: fix infinite loop when expanding a macro at the end of file +- coresight: etm4x: Set skip_power_up in etm4_init_arch_data function +- coresight: Fix issue where a source device's helpers aren't disabled +- arm64: dts: broadcom: bcmbca: bcm4908: drop invalid switch cells +- tty: serial: samsung: fix tx_empty() to return TIOCSER_TEMT +- serial: max310x: fix syntax error in IRQ error message +- tty: vt: fix 20 vs 0x20 typo in EScsiignore +- usb: phy: generic: Get the vbus supply +- iio: pressure: mprls0025pa fix off-by-one enum +- remoteproc: stm32: Fix incorrect type assignment returned by stm32_rproc_get_loaded_rsc_tablef +- remoteproc: stm32: Fix incorrect type in assignment for va +- mei: gsc_proxy: match component when GSC is on different bus +- comedi: comedi_test: Prevent timers rescheduling during deletion +- io_uring/net: correct the type of variable +- afs: Revert "afs: Hide silly-rename files from userspace" +- f2fs: zone: fix to remove pow2 check condition for zoned block device +- f2fs: compress: fix reserve_cblocks counting error when out of space +- f2fs: compress: relocate some judgments in f2fs_reserve_compress_blocks +- NFSv4.1/pnfs: fix NFS with TLS in pnfs +- NFS: Fix an off by one in root_nfs_cat() +- NFS: Fix nfs_netfs_issue_read() xarray locking for writeback interrupt +- Input: iqs7222 - add support for IQS7222D v1.1 and v1.2 +- RDMA/mana_ib: Fix bug in creation of dma regions +- f2fs: ro: compress: fix to avoid caching unaligned extent +- f2fs: fix to use correct segment type in f2fs_allocate_data_block() +- watchdog: stm32_iwdg: initialize default timeout +- watchdog: starfive: Check pm_runtime_enabled() before decrementing usage counter +- f2fs: check number of blocks in a current section +- f2fs: compress: fix to check compress flag w/ .i_sem lock +- NFSv4.2: fix listxattr maximum XDR buffer size +- NFSv4.2: fix nfs4_listxattr kernel BUG at mm/usercopy.c:102 +- net: sunrpc: Fix an off by one in rpc_sockaddr2uaddr() +- f2fs: compress: fix to check zstd compress level correctly in mount option +- f2fs: fix to create selinux label during whiteout initialization +- scsi: bfa: Fix function pointer type mismatch for hcb_qe->cbfn +- RDMA/rtrs-clt: Check strnlen return len in sysfs mpath_policy_store() +- RDMA/device: Fix a race between mad_client and cm_client init +- i3c: dw: Disable IBI IRQ depends on hot-join and SIR enabling +- scsi: csiostor: Avoid function pointer casts +- f2fs: fix to avoid potential panic during recovery +- f2fs: compress: fix to cover f2fs_disable_compressed_file() w/ i_sem +- f2fs: zone: fix to wait completion of last bio in zone correctly +- f2fs: fix to remove unnecessary f2fs_bug_on() to avoid panic +- f2fs: compress: fix to avoid inconsistence bewteen i_blocks and dnode +- f2fs: update blkaddr in __set_data_blkaddr() for cleanup +- f2fs: introduce get_dnode_addr() to clean up codes +- f2fs: delete obsolete FI_DROP_CACHE +- f2fs: delete obsolete FI_FIRST_BLOCK_WRITTEN +- f2fs: compress: fix to check unreleased compressed cluster +- f2fs: compress: fix to cover normal cluster write with cp_rwsem +- f2fs: compress: fix to guarantee persisting compressed blocks by CP +- RDMA/srpt: Do not register event handler until srpt device is fully setup +- RDMA/irdma: Remove duplicate assignment +- ALSA: usb-audio: Stop parsing channels bits when all channels are found. +- ALSA: hda/tas2781: restore power state after system_resume +- ALSA: hda/tas2781: configure the amp after firmware load +- ALSA: hda/tas2781: do not call pm_runtime_force_* in system_resume/suspend +- ALSA: hda/tas2781: add ptrs to calibration functions +- ALSA: hda/tas2781: do not reset cur_* values in runtime_suspend +- ALSA: hda/tas2781: add lock to system_suspend +- ALSA: hda/tas2781: use dev_dbg in system_resume +- ALSA: hda/realtek: fix ALC285 issues on HP Envy x360 laptops +- cifs: Fix writeback data corruption +- cifs: Don't use certain unnecessary folio_*() functions +- smb: do not test the return value of folio_start_writeback() +- PCI: brcmstb: Fix broken brcm_pcie_mdio_write() polling +- clk: zynq: Prevent null pointer dereference caused by kmalloc failure +- clk: Fix clk_core_get NULL dereference +- sparc32: Fix section mismatch in leon_pci_grpci +- backlight: lp8788: Fully initialize backlight_properties during probe +- backlight: lm3639: Fully initialize backlight_properties during probe +- backlight: da9052: Fully initialize backlight_properties during probe +- backlight: lm3630a: Don't set bl->props.brightness in get_brightness +- backlight: lm3630a: Initialize backlight_properties on init +- backlight: ktz8866: Correct the check for of_property_read_u32 +- leds: sgm3140: Add missing timer cleanup and flash gpio control +- leds: aw2013: Unlock mutex before destroying it +- powerpc/embedded6xx: Fix no previous prototype for avr_uart_send() etc. +- mfd: cs42l43: Fix wrong GPIO_FN_SEL and SPI_CLK_CONFIG1 defaults +- modules: wait do_free_init correctly +- drm/msm/dpu: add division of drm_display_mode's hskew parameter +- clk: qcom: gcc-ipq5018: fix register offset for GCC_UBI0_AXI_ARES reset +- clk: qcom: gcc-ipq5018: fix 'halt_reg' offset of 'gcc_pcie1_pipe_clk' +- clk: qcom: gcc-ipq5018: fix 'enable_reg' offset of 'gcc_gmac0_sys_clk' +- powerpc/hv-gpci: Fix the H_GET_PERF_COUNTER_INFO hcall return value checks +- powerpc/pseries: Fix potential memleak in papr_get_attr() +- mfd: cs42l43: Fix wrong register defaults +- drm/mediatek: Fix a null pointer crash in mtk_drm_crtc_finish_page_flip +- gpio: nomadik: fix offset bug in nmk_pmx_set() +- drm/amd/pm: Fix esm reg mask use to get pcie speed +- drm/tests: helpers: Include missing drm_drv header +- arm64: ftrace: Don't forbid CALL_OPS+CC_OPTIMIZE_FOR_SIZE with Clang +- media: mediatek: vcodec: avoid -Wcast-function-type-strict warning +- media: ttpci: fix two memleaks in budget_av_attach +- media: go7007: fix a memleak in go7007_load_encoder +- media: dvb-frontends: avoid stack overflow warnings with clang +- drm/amdgpu: Fix missing break in ATOM_ARG_IMM Case of atom_get_src_int() +- HID: amd_sfh: Avoid disabling the interrupt +- HID: amd_sfh: Update HPD sensor structure elements +- perf pmu: Fix a potential memory leak in perf_pmu__lookup() +- ASoC: meson: axg-tdm-interface: add frame rate constraint +- ASoC: meson: axg-tdm-interface: fix mclk setup without mclk-fs +- mtd: rawnand: lpc32xx_mlc: fix irq handler prototype +- mtd: maps: physmap-core: fix flash size larger than 32-bit +- clk: imx: imx8mp: Fix SAI_MCLK_SEL definition +- drm/tidss: Fix sync-lost issue with two displays +- drm/tidss: Fix initial plane zpos values +- crypto: jitter - fix CRYPTO_JITTERENTROPY help text +- crypto: ccp - Avoid discarding errors in psp_send_platform_access_msg() +- crypto: arm/sha - fix function cast warnings +- perf print-events: make is_event_supported() more robust +- mfd: altera-sysmgr: Call of_node_put() only when of_parse_phandle() takes a ref +- mfd: syscon: Call of_node_put() only when of_parse_phandle() takes a ref +- media: i2c: imx290: Fix IMX920 typo +- media: ivsc: csi: Swap SINK and SOURCE pads +- drm/tegra: put drm_gem_object ref on error in tegra_fb_create +- clk: mediatek: mt7981-topckgen: flag SGM_REG_SEL as critical +- clk: mediatek: mt8183: Correct parent of CLK_INFRA_SSPM_32K_SELF +- clk: mediatek: mt7622-apmixedsys: Fix an error handling path in clk_mt8135_apmixed_probe() +- clk: mediatek: mt8135: Fix an error handling path in clk_mt8135_apmixed_probe() +- clk: hisilicon: hi3559a: Fix an erroneous devm_kfree() +- clk: hisilicon: hi3519: Release the correct number of gates in hi3519_clk_unregister() +- pinctrl: renesas: Allow the compiler to optimize away sh_pfc_pm +- PCI: Mark 3ware-9650SE Root Port Extended Tags as broken +- drm/mediatek: dsi: Fix DSI RGB666 formats and definitions +- drm/panel: boe-tv101wum-nl6: make use of prepare_prev_first +- drm/amd/display: Add 'replay' NULL check in 'edp_set_replay_allow_active()' +- clk: qcom: dispcc-sdm845: Adjust internal GDSC wait times +- media: pvrusb2: fix pvr2_stream_callback casts +- media: pvrusb2: remove redundant NULL check +- media: go7007: add check of return value of go7007_read_addr() +- media: imx: csc/scaler: fix v4l2_ctrl_handler memory leak +- media: sun8i-di: Fix chroma difference threshold +- media: sun8i-di: Fix power on/off sequences +- media: sun8i-di: Fix coefficient writes +- media: cedrus: h265: Fix configuring bitstream size +- NTB: fix possible name leak in ntb_register_device() +- drm: ci: use clk_ignore_unused for apq8016 +- ASoC: SOF: Add some bounds checking to firmware data +- powerpc: Force inlining of arch_vmap_p{u/m}d_supported() +- ASoC: meson: t9015: fix function pointer type mismatch +- ASoC: meson: aiu: fix function pointer type mismatch +- perf metric: Don't remove scale from counts +- perf stat: Avoid metric-only segv +- perf expr: Fix "has_event" function for metric style events +- ALSA: seq: fix function cast warnings +- clk: renesas: r8a779f0: Correct PFC/GPIO parent clock +- clk: renesas: r8a779g0: Correct PFC/GPIO parent clocks +- drm/amd/display: fix NULL checks for adev->dm.dc in amdgpu_dm_fini() +- drm/radeon/ni: Fix wrong firmware size logging in ni_init_microcode() +- drm/msm/dpu: Only enable DSC_MODE_MULTIPLEX if dsc_merge is enabled +- drm/msm/dpu: fix the programming of INTF_CFG2_DATA_HCTL_EN +- dt-bindings: msm: qcom, mdss: Include ommited fam-b compatible +- perf srcline: Add missed addr2line closes +- perf thread_map: Free strlist on normal path in thread_map__new_by_tid_str() +- drivers/ps3: select VIDEO to provide cmdline functions +- crypto: xilinx - call finalize with bh disabled +- PCI: switchtec: Fix an error handling path in switchtec_pci_probe() +- PCI/P2PDMA: Fix a sleeping issue in a RCU read section +- quota: Properly annotate i_dquot arrays with __rcu +- quota: Fix rcu annotations of inode dquot pointers +- clk: qcom: reset: Ensure write completion on reset de/assertion +- clk: qcom: reset: Commonize the de/assert functions +- drm/amdgpu: Fix potential out-of-bounds access in 'amdgpu_discovery_reg_base_init()' +- pinctrl: mediatek: Drop bogus slew rate register range for MT8192 +- pinctrl: mediatek: Drop bogus slew rate register range for MT8186 +- media: edia: dvbdev: fix a use-after-free +- mtd: spinand: esmt: Extend IDs to 5 bytes +- media: v4l2-mem2mem: fix a memleak in v4l2_m2m_register_entity +- media: v4l2-tpg: fix some memleaks in tpg_alloc +- media: em28xx: annotate unchecked call to media_device_register() +- clk: meson: Add missing clocks to axg_clk_regmaps +- perf bpf: Clean up the generated/copied vmlinux.h +- perf evsel: Fix duplicate initialization of data->id in evsel__parse_sample() +- media: v4l2: cci: print leading 0 on error +- clk: samsung: exynos850: Propagate SPI IPCLK rate change +- pinctrl: renesas: r8a779g0: Add missing SCIF_CLK2 pin group/function +- drm/vmwgfx: Fix vmw_du_get_cursor_mob fencing of newly-created MOBs +- ASoC: sh: rz-ssi: Fix error message print +- drm/amd/display: Fix potential NULL pointer dereferences in 'dcn10_set_output_transfer_func()' +- perf pmu: Treat the msr pmu as software +- drm/amd/display: Fix a potential buffer overflow in 'dp_dsc_clock_en_read()' +- HID: lenovo: Add middleclick_workaround sysfs knob for cptkbd +- perf record: Check conflict between '--timestamp-filename' option and pipe mode before recording +- perf top: Uniform the event name for the hybrid machine +- perf record: Fix possible incorrect free in record__switch_output() +- PCI/DPC: Print all TLP Prefixes, not just the first +- media: cadence: csi2rx: use match fwnode for media link +- media: tc358743: register v4l2 async device only after successful setup +- dmaengine: tegra210-adma: Update dependency to ARCH_TEGRA +- ASoC: SOF: amd: Fix memory leak in amd_sof_acp_probe() +- ASoC: amd: acp: Add missing error handling in sof-mach +- drm/lima: fix a memleak in lima_heap_alloc +- drm/panel-edp: use put_sync in unprepare +- drm/rockchip: lvds: do not print scary message when probing defer +- drm/rockchip: lvds: do not overwrite error code +- drm/vmwgfx: fix a memleak in vmw_gmrid_man_get_node +- drm/vkms: Avoid reading beyond LUT array +- drm: Don't treat 0 as -1 in drm_fixp2int_ceil +- drm/rockchip: inno_hdmi: Fix video timing +- drm/tegra: output: Fix missing i2c_put_adapter() in the error handling paths of tegra_output_probe() +- drm/tegra: rgb: Fix missing clk_put() in the error handling paths of tegra_dc_rgb_probe() +- drm/tegra: rgb: Fix some error handling paths in tegra_dc_rgb_probe() +- drm/tegra: hdmi: Fix some error handling paths in tegra_hdmi_probe() +- drm/tegra: dsi: Fix missing pm_runtime_disable() in the error handling path of tegra_dsi_probe() +- drm/tegra: dsi: Fix some error handling paths in tegra_dsi_probe() +- drm/tegra: dpaux: Fix PM disable depth imbalance in tegra_dpaux_probe +- drm/tegra: dsi: Add missing check for of_find_device_by_node +- dm: call the resume method on internal suspend +- dm raid: fix false positive for requeue needed during reshape +- bpf: hardcode BPF_PROG_PACK_SIZE to 2MB * num_possible_nodes() +- nfp: flower: handle acti_netdevs allocation failure +- net/x25: fix incorrect parameter validation in the x25_getsockopt() function +- net: kcm: fix incorrect parameter validation in the kcm_getsockopt) function +- udp: fix incorrect parameter validation in the udp_lib_getsockopt() function +- l2tp: fix incorrect parameter validation in the pppol2tp_getsockopt() function +- ipmr: fix incorrect parameter validation in the ip_mroute_getsockopt() function +- tcp: fix incorrect parameter validation in the do_tcp_getsockopt() function +- OPP: debugfs: Fix warning around icc_get_name() +- erofs: fix lockdep false positives on initializing erofs_pseudo_mnt +- net: phy: dp83822: Fix RGMII TX delay configuration +- Bluetooth: Fix eir name length +- net: phy: fix phy_get_internal_delay accessing an empty array +- net: ip_tunnel: make sure to pull inner header in ip_tunnel_rcv() +- ipv6: fib6_rules: flush route cache when rule is changed +- iommu: Fix compilation without CONFIG_IOMMU_INTEL +- bpf: Fix stackmap overflow check on 32-bit arches +- bpf: Fix hashtab overflow check on 32-bit arches +- bpf: Fix DEVMAP_HASH overflow check on 32-bit arches +- s390/cache: prevent rebuild of shared_cpu_list +- Bluetooth: fix use-after-free in accessing skb after sending it +- Bluetooth: af_bluetooth: Fix deadlock +- Bluetooth: btusb: Fix memory leak +- Bluetooth: msft: Fix memory leak +- Bluetooth: msft: __hci_cmd_sync() doesn't return NULL +- Bluetooth: hci_core: Fix possible buffer overflow +- Bluetooth: btrtl: fix out of bounds memory access +- Bluetooth: hci_h5: Add ability to allocate memory for private data +- Bluetooth: hci_sync: Fix overwriting request callback +- Bluetooth: hci_core: Cancel request on command timeout +- Bluetooth: hci_qca: don't use IS_ERR_OR_NULL() with gpiod_get_optional() +- Bluetooth: hci_event: Fix not indicating new connection for BIG Sync +- Bluetooth: Remove BT_HS +- Bluetooth: Remove superfluous call to hci_conn_check_pending() +- Bluetooth: mgmt: Remove leftover queuing of power_off work +- Bluetooth: Remove HCI_POWER_OFF_TIMEOUT +- ice: fix stats being updated by way too large values +- igb: Fix missing time sync events +- igc: Fix missing time sync events +- iommu/vt-d: Don't issue ATS Invalidation request when device is disconnected +- PCI: Make pci_dev_is_disconnected() helper public for other drivers +- wifi: brcm80211: handle pmk_op allocation failure +- wifi: rtw88: 8821c: Fix false alarm count +- wifi: rtw88: 8821c: Fix beacon loss and disconnect +- wifi: rtw88: 8821cu: Fix firmware upload fail +- ACPI: CPPC: enable AMD CPPC V2 support for family 17h processors +- mmc: wmt-sdmmc: remove an incorrect release_mem_region() call in the .remove function +- arm64: dts: qcom: sm8550: Fix SPMI channels size +- SUNRPC: fix some memleaks in gssx_dec_option_array +- SUNRPC: fix a memleak in gss_import_v2_context +- x86, relocs: Ignore relocations in .notes section +- objtool: Fix UNWIND_HINT_{SAVE,RESTORE} across basic blocks +- arm64: dts: rockchip: drop rockchip,trcm-sync-tx-only from rk3588 i2s +- arm64: dts: rockchip: fix reset-names for rk356x i2s2 controller +- arm64: dts: rockchip: add missing interrupt-names for rk356x vdpu +- ACPI: scan: Fix device check notification handling +- ACPI: resource: Add MAIBENBEN X577 to irq1_edge_low_force_override +- ACPI: resource: Do IRQ override on Lunnen Ground laptops +- ACPI: resource: Add Infinity laptops to irq1_edge_low_force_override +- arm64: dts: marvell: reorder crypto interrupts on Armada SoCs +- gpiolib: Pass consumer device through to core in devm_fwnode_gpiod_get_index() +- regulator: userspace-consumer: add module device table +- arm64: dts: imx8mp-evk: Fix hdmi@3d node +- arm64: dts: imx8mp: Set SPI NOR to max 40 MHz on Data Modul i.MX8M Plus eDM SBC +- ARM: dts: imx6dl-yapp4: Move the internal switch PHYs under the switch node +- ARM: dts: imx6dl-yapp4: Fix typo in the QCA switch register address +- arm64: dts: allwinner: h6: Add RX DMA channel for SPDIF +- pstore: inode: Only d_invalidate() is needed +- pstore: inode: Convert mutex usage to guard(mutex) +- net: mctp: copy skb ext data when fragmenting +- arm64: dts: renesas: r8a779g0: Correct avb[01] reg sizes +- arm64: dts: renesas: r8a779a0: Correct avb[01] reg sizes +- arm64: dts: renesas: rzg2l: Add missing interrupts to IRQC nodes +- wifi: mt76: mt792x: fix a potential loading failure of the 6Ghz channel config from ACPI +- wifi: mt76: mt7921e: fix use-after-free in free_irq() +- wifi: mt76: mt792x: fix ethtool warning +- wifi: mt76: mt7996: fix HIF_TXD_V2_1 value +- wifi: mt76: mt7996: fix efuse reading issue +- wifi: mt76: mt7996: fix HE beamformer phy cap for station vif +- wifi: mt76: mt7996: fix incorrect interpretation of EHT MCS caps +- wifi: mt76: mt7996: fix TWT issues +- memory: tegra: Correct DLA client names +- ARM: dts: arm: realview: Fix development chip ROM compatible value +- wifi: wilc1000: revert reset line logic flip +- arm64: dts: ti: k3-am62p: Fix memory ranges for DMSS +- firmware: arm_scmi: Fix double free in SMC transport cleanup path +- arm64: dts: ti: Add common1 register space for AM62x SoC +- arm64: dts: ti: Add common1 register space for AM65x SoC +- arm64: dts: mt8195-cherry-tomato: change watchdog reset boot flow +- arm64: dts: ti: k3-am64-main: Fix ITAP/OTAP values for MMC +- arm64: dts: ti: k3-am64: Enable SDHCI nodes at the board level +- arm64: dts: ti: k3-am642-sk: Add boot phase tags marking +- arm64: dts: ti: k3-am642-evm: Add boot phase tags marking +- arm64: dts: ti: k3-j784s4-evm: Remove Pinmux for CTS and RTS in wkup_uart0 +- arm64: dts: ti: k3-j721s2-common-proc-board: Remove Pinmux for CTS and RTS in wkup_uart0 +- arm64: dts: ti: k3-j7200-common-proc-board: Remove clock-frequency from mcu_uart0 +- arm64: dts: ti: k3-j7200-common-proc-board: Modify Pinmux for wkup_uart0 and mcu_uart0 +- net: ena: Remove ena_select_queue +- powercap: dtpm_cpu: Fix error check against freq_qos_add_request() +- arm64: dts: qcom: sm8150: correct PCIe wake-gpios +- arm64: dts: qcom: sm8150: use 'gpios' suffix for PCI GPIOs +- arm64: dts: qcom: sdm845-db845c: correct PCIe wake-gpios +- wifi: brcmsmac: avoid function pointer casts +- iommu/amd: Mark interrupt as managed +- bus: tegra-aconnect: Update dependency to ARCH_TEGRA +- arm64: dts: ti: k3-am62-main: disable usb lpm +- wifi: wilc1000: prevent use-after-free on vif when cleaning up all interfaces +- cpufreq: qcom-hw: add CONFIG_COMMON_CLK dependency +- arm64: dts: mediatek: mt8186: Add missing xhci clock to usb controllers +- arm64: dts: mediatek: mt8186: Add missing clocks to ssusb power domains +- ARM: dts: qcom: msm8974: correct qfprom node size +- soc: qcom: llcc: Check return value on Broadcast_OR reg read +- arm64: dts: qcom: sdm845: Use the Low Power Island CX/MX for SLPI +- bpf: Mark bpf_spin_{lock,unlock}() helpers with notrace correctly +- wifi: iwlwifi: mvm: Fix the listener MAC filter flags +- can: m_can: Start/Cancel polling timer together with interrupts +- arm64: dts: mediatek: mt7622: add missing "device_type" to memory nodes +- arm64: dts: mediatek: mt8186: fix VENC power domain clocks +- arm64: dts: mediatek: mt8192: fix vencoder clock name +- arm64: dts: mediatek: mt8192-asurada: Remove CrosEC base detection node +- arm64: dts: mediatek: mt7986: add "#reset-cells" to infracfg +- arm64: dts: mediatek: mt7986: drop "#clock-cells" from PWM +- arm64: dts: mediatek: mt7986: fix SPI nodename +- arm64: dts: mediatek: mt7986: fix SPI bus width properties +- arm64: dts: mediatek: mt7986: drop crypto's unneeded/invalid clock name +- arm64: dts: mediatek: mt7986: fix reference to PWM in fan node +- arm64: dts: mt8183: Move CrosEC base detection node to kukui-based DTs +- ipv6: mcast: remove one synchronize_net() barrier in ipv6_mc_down() +- selftests: forwarding: Add missing multicast routing config entries +- selftests: forwarding: Add missing config entries +- s390/vdso: drop '-fPIC' from LDFLAGS +- s390/pai: fix attr_event_free upper limit for pai device drivers +- wifi: iwlwifi: mvm: don't set replay counters to 0xff +- wifi: iwlwifi: mvm: don't set the MFP flag for the GTK +- wifi: iwlwifi: mvm: fix erroneous queue index mask +- wifi: iwlwifi: support EHT for WH +- tools/resolve_btfids: Fix cross-compilation to non-host endianness +- tools/resolve_btfids: Refactor set sorting with types from btf_ids.h +- pwm: sti: Fix capture for st,pwm-num-chan < st,capture-num-chan +- printk: Disable passing console lock owner completely during panic() +- wifi: ath12k: fix incorrect logic of calculating vdev_stats_id +- arm64: dts: qcom: sm6115: declare VLS CLAMP register for USB3 PHY +- arm64: dts: qcom: qcm2290: declare VLS CLAMP register for USB3 PHY +- wifi: wfx: fix memory leak when starting AP +- libbpf: Use OPTS_SET() macro in bpf_xdp_query() +- wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer() +- wifi: ath11k: initialize rx_mcs_80 and rx_mcs_160 before use +- arm64: dts: ti: k3-j784s4: Fix power domain for VTM node +- arm64: dts: ti: k3-j721s2: Fix power domain for VTM node +- net: blackhole_dev: fix build warning for ethh set but not used +- pwm: atmel-hlcdc: Fix clock imbalance related to suspend support +- arm64: dts: imx8mm-venice-gw71xx: fix USB OTG VBUS +- gpio: vf610: allow disabling the vf610 driver +- wifi: iwlwifi: read BIOS PNVM only for non-Intel SKU +- wifi: iwlwifi: mvm: fix the TLC command after ADD_STA +- wifi: iwlwifi: mvm: d3: fix IPN byte order +- wifi: iwlwifi: fix EWRD table validity check +- wifi: iwlwifi: mvm: initialize rates in FW earlier +- wifi: iwlwifi: acpi: fix WPFC reading +- wifi: iwlwifi: dbg-tlv: ensure NUL termination +- wifi: iwlwifi: mvm: report beacon protection failures +- wifi: ath12k: fix fetching MCBC flag for QCN9274 +- wifi: ath12k: Update Qualcomm Innovation Center, Inc. copyrights +- wifi: ath11k: change to move WMI_VDEV_PARAM_SET_HEMU_MODE before WMI_PEER_ASSOC_CMDID +- wifi: ath9k: delay all of ath9k_wmi_event_tasklet() until init is complete +- libbpf: Add missing LIBBPF_API annotation to libbpf_set_memlock_rlim API +- arm64: dts: imx8mm-kontron: Fix interrupt for RTC on OSM-S i.MX8MM module +- arm64: dts: imx8mm-kontron: Disable pull resistors for SD card signals on BL board +- arm64: dts: imx8mm-kontron: Disable pull resistors for SD card signals on BL OSM-S board +- arm64: dts: imx8mm-kontron: Disable pullups for onboard UART signals on BL board +- arm64: dts: imx8mm-kontron: Disable pullups for onboard UART signals on BL OSM-S board +- arm64: dts: imx8mm-kontron: Disable pullups for I2C signals on SL/BL i.MX8MM +- arm64: dts: imx8mm-kontron: Disable pullups for I2C signals on OSM-S i.MX8MM +- selftests/bpf: Disable IPv6 for lwt_redirect test +- arm64: dts: renesas: r8a779g0: Add missing SCIF_CLK2 +- arm64: dts: renesas: r8a779g0: Restore sort order +- arm64: dts: qcom: sa8540p: Drop gfx.lvl as power-domain for gpucc +- pmdomain: qcom: rpmhpd: Drop SA8540P gfx.lvl +- libbpf: Fix faccessat() usage on Android +- cpufreq: mediatek-hw: Don't error out if supply is not found +- arm64: dts: qcom: sdm845-oneplus-common: improve DAI node naming +- soc: qcom: socinfo: rename PM2250 to PM4125 +- arm64: dts: qcom: sm8450: Add missing interconnects to serial +- af_unix: Annotate data-race of gc_in_progress in wait_for_unix_gc(). +- selftests/bpf: Wait for the netstamp_needed_key static key to be turned on +- selftests/bpf: Fix the flaky tc_redirect_dtime test +- selftests/bpf: Add netkit to tc_redirect selftest +- selftests/bpf: De-veth-ize the tc_redirect test case +- wifi: ath12k: Fix issues in channel list update +- selftest/bpf: Add map_in_maps with BPF_MAP_TYPE_PERF_EVENT_ARRAY values +- libbpf: Apply map_set_def_max_entries() for inner_maps on creation +- selftests/bpf: Fix potential premature unload in bpf_testmod +- bpftool: Silence build warning about calloc() +- inet_diag: annotate data-races around inet_diag_table[] +- sock_diag: annotate data-races around sock_diag_handlers[family] +- cpufreq: mediatek-hw: Wait for CPU supplies before probing +- cpufreq: brcmstb-avs-cpufreq: add check for cpufreq_cpu_get's return value +- arm64: dts: qcom: sc8180x: Shrink aoss_qmp register space size +- arm64: dts: qcom: sc8180x: Require LOW_SVS vote for MMCX if DISPCC is on +- arm64: dts: qcom: sc8180x: Don't hold MDP core clock at FMAX +- arm64: dts: qcom: sc8180x: Fix eDP PHY power-domains +- arm64: dts: qcom: sc8180x: Add missing CPU off state +- arm64: dts: qcom: sc8180x: Fix up big CPU idle state entry latency +- arm64: dts: qcom: sc8180x: Hook up VDD_CX as GCC parent domain +- ARM: dts: renesas: r8a73a4: Fix external clocks and clock rate +- wifi: mwifiex: debugfs: Drop unnecessary error check for debugfs_create_dir() +- wifi: wilc1000: fix multi-vif management when deleting a vif +- wifi: wilc1000: do not realloc workqueue everytime an interface is added +- wifi: rtl8xxxu: add cancel_work_sync() for c2hcmd_work +- wifi: wilc1000: fix RCU usage in connect path +- wifi: wilc1000: fix declarations ordering +- wifi: b43: Disable QoS for bcm4331 +- wifi: b43: Stop correct queue in DMA worker when QoS is disabled +- wifi: b43: Stop/wake correct queue in PIO Tx path when QoS is disabled +- wifi: b43: Stop/wake correct queue in DMA Tx path when QoS is disabled +- wifi: ath10k: fix NULL pointer dereference in ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev() +- timekeeping: Fix cross-timestamp interpolation for non-x86 +- timekeeping: Fix cross-timestamp interpolation corner case decision +- timekeeping: Fix cross-timestamp interpolation on counter wrap +- x86/sme: Fix memory encryption setting if enabled by default and not overridden +- x86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type +- aoe: fix the potential use-after-free problem in aoecmd_cfg_pkts +- io_uring/net: fix overflow check in io_recvmsg_mshot_prep() +- io_uring/net: move receive multishot out of the generic msghdr path +- io_uring/net: unify how recvmsg and sendmsg copy in the msghdr +- rtc: test: Fix invalid format specifier. +- time: test: Fix incorrect format specifier +- lib: memcpy_kunit: Fix an invalid format specifier in an assertion msg +- lib/cmdline: Fix an invalid format specifier in an assertion msg +- kunit: test: Log the correct filter string in executor_test +- ovl: Always reject mounting over case-insensitive directories +- ovl: add support for appending lowerdirs one by one +- ovl: refactor layer parsing helpers +- ovl: store and show the user provided lowerdir mount option +- ovl: remove unused code in lowerdir param parsing +- md: Don't clear MD_CLOSING when the raid is about to stop +- fs/select: rework stack allocation hack for clang +- rcu/exp: Handle RCU expedited grace period kworker allocation failure +- rcu/exp: Fix RCU expedited parallel grace period kworker allocation failure recovery +- s390/dasd: fix double module refcount decrement +- s390/dasd: Use dev_*() for device log messages +- io_uring: remove unconditional looping in local task_work handling +- io_uring: remove looping around handling traditional task_work +- fs: Fix rw_hint validation +- workqueue: Introduce struct wq_node_nr_active +- workqueue: Make wq_adjust_max_active() round-robin pwqs while activating +- workqueue: Move nr_active handling into helpers +- workqueue: Replace pwq_activate_inactive_work() with [__]pwq_activate_work() +- workqueue: Factor out pwq_is_empty() +- workqueue: Move pwq->max_active to wq->max_active +- workqueue.c: Increase workqueue name length +- ASoC: wm8962: Fix up incorrect error message in wm8962_set_fll +- ASoC: wm8962: Enable both SPKOUTR_ENA and SPKOUTL_ENA in mono mode +- ASoC: wm8962: Enable oscillator if selecting WM8962_FLL_OSC +- Input: gpio_keys_polled - suppress deferred probe error for gpio +- xfrm: set skb control buffer based on packet offload as well +- xfrm: fix xfrm child route lookup for packet offload +- ASoC: amd: yc: Add HP Pavilion Aero Laptop 13-be2xxx(8BD6) into DMI quirk table +- x86/hyperv: Allow 15-bit APIC IDs for VTL platforms +- ASoC: Intel: bytcr_rt5640: Add an extra entry for the Chuwi Vi8 tablet +- arm64: tegra: Set the correct PHY mode for MGBE +- perf: RISCV: Fix panic on pmu overflow handler +- firewire: core: use long bus reset on gap count error +- Bluetooth: mgmt: Fix limited discoverable off timeout +- ASoC: amd: yc: Fix non-functional mic on Lenovo 21J2 +- drm/amdgpu: Enable gpu reset for S3 abort cases on Raven series +- ALSA: hda/realtek - ALC285 reduce pop noise from Headphone port +- scsi: mpt3sas: Prevent sending diag_reset when the controller is ready +- ASoC: amd: yc: Add Lenovo ThinkBook 21J0 into DMI quirk table +- drm/ttm/tests: depend on UML || COMPILE_TEST +- wifi: mac80211: only call drv_sta_rc_update for uploaded stations +- net: smsc95xx: add support for SYS TEC USB-SPEmodule1 +- regulator: max5970: Fix regulator child node name +- ARM: dts: renesas: rcar-gen2: Add missing #interrupt-cells to DA9063 nodes +- arm64: dts: qcom: Fix interrupt-map cell sizes +- arm: dts: Fix dtc interrupt_map warnings +- arm64: dts: Fix dtc interrupt_provider warnings +- arm: dts: Fix dtc interrupt_provider warnings +- dm-verity, dm-crypt: align "struct bvec_iter" correctly +- platform/x86: x86-android-tablets: Fix acer_b1_750_goodix_gpios name +- perf: CXL: fix CPMU filter value mask length +- cxl/region: Allow out of order assembly of autodiscovered regions +- cxl/region: Handle endpoint decoders in cxl_region_find_decoder() +- block: sed-opal: handle empty atoms when parsing response +- parisc/ftrace: add missing CONFIG_DYNAMIC_FTRACE check +- net/iucv: fix the allocation size of iucv_path_table array +- x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() +- x86/mm: Move is_vsyscall_vaddr() into asm/vsyscall.h +- riscv: dts: sifive: add missing #interrupt-cells to pmic +- ARM: dts: rockchip: Drop interrupts property from pwm-rockchip nodes +- RDMA/mlx5: Relax DEVX access upon modify commands +- RDMA/mlx5: Fix fortify source warning while accessing Eth segment +- arm64: dts: rockchip: mark system power controller on rk3588-evb1 +- soc: microchip: Fix POLARFIRE_SOC_SYS_CTRL input prompt +- arm64/sve: Lower the maximum allocation for the SVE ptrace regset +- gen_compile_commands: fix invalid escape sequence warning +- ASoC: SOF: ipc4-pcm: Workaround for crashed firmware on system suspend +- HID: multitouch: Add required quirk for Synaptics 0xcddc device +- MIPS: Clear Cause.BD in instruction_pointer_set +- x86/xen: Add some null pointer checking to smp.c +- ASoC: amd: yc: Fix non-functional mic on Lenovo 82UU +- regmap: kunit: Ensure that changed bytes are actually different +- spi: intel-pci: Add support for Lunar Lake-M SPI serial flash +- ASoC: rt5645: Make LattePanda board DMI match more precise +- selftests: tls: use exact comparison in recv_partial +- selftests: openvswitch: Add validation for the recursion test +- perf/arm-cmn: Workaround AmpereOneX errata AC04_MESH_1 (incorrect child count) +- wifi: iwlwifi: mvm: use correct address 3 in A-MSDU +- ASoC: cs42l43: Handle error from devm_pm_runtime_enable +- media: rkisp1: Fix IRQ handling due to shared interrupts +- soc: qcom: pmic_glink_altmode: fix drm bridge use-after-free +- io_uring: drop any code related to SCM_RIGHTS +- io_uring/unix: drop usage of io_uring socket +- platform/x86: p2sb: On Goldmont only cache P2SB and SPI devfn BAR +- !6730 quota: Fix potential NULL pointer dereference +- quota: Fix potential NULL pointer dereference +- !6782 i2c: hisi: Add I2C controller reset and initialization proccess in bus recovery action +- i2c: hisi: Correct the description comment for PIN_MUX METHOD +- i2c: hisi: Add I2C controller reset and initialization proccess in bus recovery action +- !6760 spi: hisi-kunpeng: Delete the dump interface of data registers in debugfs +- spi: hisi-kunpeng: Delete the dump interface of data registers in debugfs +- !3176 [OLK-6.6] Turning off Zhaoxin ahci controller runtime pm +- Turning off Zhaoxin ahci controller runtime pm +- !6403 iommu/arm-smmu-v3: fix using uninitialized or unchecked symbol +- iommu/arm-smmu-v3: fix using uninitialized or unchecked symbol +- !6479 do_sys_name_to_handle(): use kzalloc() to fix kernel-infoleak +- do_sys_name_to_handle(): use kzalloc() to fix kernel-infoleak +- !6005 [OLK-6.6]Add Yunsilicon eth driver and rdma driver +- drivers: support for xsc drivers from Yunsilicon Technology +- !6595 A Solution to Re-enable hugetlb vmemmap optimize on ARM64 +- arm64: update openeuler_defconfig for HVO enable +- arm64: mm: Re-enable OPTIMIZE_HUGETLB_VMEMMAP +- arm64: mm: HVO: support BBM of vmemmap pgtable safely +- mm: HVO: introduce helper function to update and flush pgtable +- !6731 [OLK-6.6] watchdog: Fix call trace when failed to initialize sdei +- watchdog: Fix call trace when failed to initialize sdei +- !6651 [OLK - 6.6]net: hns3: add support for Hisilicon ptp sync device +- net: hns3: add support for Hisilicon ptp sync device +- !6385 ipvlan: Fix warning while IPVLAN_L2E disabled +- ipvlan: Fix warning while IPVLAN_L2E disabled +- !6409 [OLK-6.6] irqchip: gic-v3: Collection table support muti pages +- irqchip: gic-v3: Collection table support muti pages +- !6735 v2 SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP +- SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP +- !6590 v6 Introduce BPF_READAHEAD option for optimizing read performance +- arch: Add BPF_READAHEAD config options for supported architectures +- mm, fs: Add BPF_READAHEAD build option for bpf readhead +- !6681 v2 btrfs: fix data races when accessing the reserved amount of block reserves +- btrfs: fix data races when accessing the reserved amount of block reserves + +* Sun Apr 28 2024 ZhangPeng - 6.6.0-23.0.0.26 +- !6306 【OLK-6.6】fix compiling problem in bzwx N5/N6 series NIC drivers +- drivers: fix compiling problem in bzwx N5/N6 series NIC drivers +- !6692 ipvlan: enable CONFIG_IPVLAN_L2E option in openeuler config +- ipvlan: enable CONFIG_IPVLAN_L2E option in openeuler config +- !6632 ext4: use iomap for regular file's buffered IO path and enable large foilo +- ext4: add mount option for buffered IO iomap path +- ext4: don't mark IOMAP_F_DIRTY for buffer write +- ext4: enable large folio for regular file with iomap buffered IO path +- filemap: support disable large folios on active inode +- ext4: partial enable iomap for regular file's buffered IO path +- ext4: fall back to buffer_head path for defrag +- ext4: writeback partial blocks before zeroing out range +- ext4: implement zero_range iomap path +- ext4: implement mmap iomap path +- ext4: implement writeback iomap path +- ext4: implement buffered write iomap path +- ext4: implement buffered read iomap path +- ext4: add a new iomap aops for regular file's buffered IO path +- ext4: introduce seq counter for the extent status entry +- ext4: factor out ext4_map_create_blocks() to allocate new blocks +- ext4: use reserved metadata blocks when splitting extent on endio +- ext4: make ext4_da_map_blocks() buffer_head unaware +- ext4: make ext4_insert_delayed_block() insert multi-blocks +- ext4: factor out check for whether a cluster is allocated +- ext4: make ext4_da_reserve_space() reserve multi-clusters +- ext4: make ext4_es_insert_delayed_block() insert multi-blocks +- ext4: drop iblock parameter +- ext4: trim delalloc extent +- ext4: check the extent status again before inserting delalloc block +- ext4: factor out a common helper to query extent map +- ext4: make ext4_set_iomap() recognize IOMAP_DELALLOC map type +- ext4: make ext4_map_blocks() distinguish delalloc only extent +- ext4: add a hole extent entry in cache after punch +- ext4: convert to exclusive lock while inserting delalloc extents +- ext4: refactor ext4_da_map_blocks() +- iomap: do some small logical cleanup in buffered write +- iomap: make iomap_write_end() return a boolean +- iomap: use a new variable to handle the written bytes in iomap_write_iter() +- iomap: don't increase i_size if it's not a write operation +- iomap: drop the write failure handles when unsharing and zeroing +- xfs: convert delayed extents to unwritten when zeroing post eof blocks +- xfs: make xfs_bmapi_convert_delalloc() to allocate the target offset +- xfs: make the seq argument to xfs_bmapi_convert_delalloc() optional +- xfs: match lock mode in xfs_buffered_write_iomap_begin() +- iomap: add pos and dirty_len into trace_iomap_writepage_map +- iomap: pass the length of the dirty region to ->map_blocks +- iomap: map multiple blocks at a time +- iomap: submit ioends immediately +- iomap: factor out a iomap_writepage_map_block helper +- iomap: only call mapping_set_error once for each failed bio +- iomap: don't chain bios +- iomap: move the iomap_sector sector calculation out of iomap_add_to_ioend +- iomap: clean up the iomap_alloc_ioend calling convention +- iomap: move all remaining per-folio logic into iomap_writepage_map +- iomap: factor out a iomap_writepage_handle_eof helper +- iomap: move the PF_MEMALLOC check to iomap_writepages +- iomap: move the io_folios field out of struct iomap_ioend +- iomap: treat inline data in iomap_writepage_map as an I/O error +- iomap: clear the per-folio dirty bits on all writeback failures +- !6625 v2 perf data convert: Fix segfault when converting to json when cpu_desc isn't set +- perf data convert: Fix segfault when converting to json when cpu_desc isn't set +- !6647 infiniband/hw/hiroce3: Add Huawei Intelligent Network Card RDMA Driver +- infiniband/hw/hiroce3: Add Huawei Intelligent Network Card RDMA Driver +- net/ethernet/huawei/hinic3: Add the CQM on which the RDMA depends +- !6624 hisi-acc-vfio-pci:add DFX for acc migration driver +- hisi_acc_vfio_pci: add exception error handling +- hisi-acc-vfio-pci:add DFX for acc migration driver +- !6658 sched: disable sched_autogroup by default +- sched: disable sched_autogroup by default +- !6626 Backport page fault and fork optimization +- mm: swapfile: check usable swap device in __folio_throttle_swaprate() +- mm/filemap: optimize filemap folio adding +- lib/xarray: introduce a new helper xas_get_order +- lib/xarray: introduce a new helper xas_get_order +- mm/filemap: clean up hugetlb exclusion code +- mm/filemap: return early if failed to allocate memory for split +- mm: memory: check userfaultfd_wp() in vmf_orig_pte_uffd_wp() +- !6179 crypto: hisilicon - fixed some code security review issues +- crypto: hisilicon/debugfs - Resolve the problem of applying for redundant space in sq dump +- crypto: hisilicon/sec - Fix memory leak for sec resource release +- crypto: hisilicon - Adjust debugfs creation and release order +- crypto: hisilicon/qm - Add the default processing branch +- crypto: hisilicon/debugfs - Fix the processing logic issue in the debugfs creation +- crypto: hisilicon/sgl - Delete redundant parameter verification +- crypto: hisilicon/debugfs - Fix debugfs uninit process issue +- crypto: hisilicon/sec - Add the condition for configuring the sriov function +- crypto: hisilicon/zip - fix the missing CRYPTO_ALG_ASYNC in cra_flags +- !6400 btrfs: fix data race at btrfs_use_block_rsv() when accessing block reserve +- btrfs: fix data race at btrfs_use_block_rsv() when accessing block reserve +- !6444 Fix CVE-2024-26869 +- f2fs: fix to truncate meta inode pages forcely +- f2fs: introduce f2fs_invalidate_internal_cache() for cleanup +- !6585 ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit() +- ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit() +- !6251 ubi: Check for too small LEB size in VTBL code +- ubi: Check for too small LEB size in VTBL code +- !6418 media: pvrusb2: fix uaf in pvr2_context_set_notify +- media: pvrusb2: fix uaf in pvr2_context_set_notify + +* Wed Apr 24 2024 Zheng Zengkai - 6.6.0-22.0.0.25 +- !6467 RDMA/hns: Some bugfixes and cleanups +- RDMA/hns: Fix incorrect variable usage in scc_attr_is_visible() +- RDMA/hns: Fix null pointer when alloc_scc_param() fails +- RDMA/hns: Fix scc_param delay_work to execute after sysfs shutdown +- RDMA/hns: Add mutex_destroy() to destroy the mutex +- RDMA/hns: Fix a potential Sleep-in-Atomic-Context +- !6468 v2 scsi: fnic: Move fnic_fnic_flush_tx() to a work queue +- scsi: fnic: Move fnic_fnic_flush_tx() to a work queue +- !6439 v3 m: convert mm's rss stats to use atomic mode +- mm: convert mm's rss stats to use atomic mode +- percpu_counter: introduce atomic mode for percpu_counter +- !6424 mm/migrate: correct nr_failed in migrate_pages_sync() +- mm/migrate: add nr_split to trace_mm_migrate_pages stats. +- mm/migrate: correct nr_failed in migrate_pages_sync() +- !6390 nfs: fix panic when nfs4_ff_layout_prepare_ds() fails +- nfs: fix panic when nfs4_ff_layout_prepare_ds() fails +- !5482 [OLK-6.6] crypto: update zhaoxin-aes for __pcpu_unique_paes_last_cword +- crypto: update zhaoxin-aes for __pcpu_unique_paes_last_cword +- !3171 [OLK-6.6] ata: libata: disabling PhyRdy Change Interrupt based on actual LPM capability +- ata: libata: disabling PhyRdy Change Interrupt based on actual LPM capability +- !6443 f2fs: fix NULL pointer dereference in f2fs_submit_page_write() +- f2fs: fix NULL pointer dereference in f2fs_submit_page_write() +- !6261 RDMA/hns: Some bugfixes and cleanups +- RDMA/hns: Modify the print level of CQE error +- RDMA/hns: Add mutex_destroy() +- RDMA/hns: Fix GMV table pagesize +- RDMA/hns: Fix mismatch exception rollback +- RDMA/hns: Fix UAF for cq async event +- RDMA/hns: Fix deadlock on SRQ async events. +- RDMA/hns: Remove unused parameters and variables +- RDMA/hns: Use macro instead of magic number +- RDMA/hns: Fix return value in hns_roce_map_mr_sg +- !6265 tpm_tis: Avoid warning splat at shutdown +- tpm,tpm_tis: Avoid warning splat at shutdown +- !6402 bpf: Add missing BPF_LINK_TYPE invocations +- bpf: Add missing BPF_LINK_TYPE invocations +- !6256 [OLK-6.6] bugfix from upstream v6.9 for AMD EPYC perf +- perf/x86/amd/core: Define a proper ref-cycles event for Zen 4 and later +- perf/x86/amd/core: Update and fix stalled-cycles-* events for Zen 2 and later +- perf/x86/amd/lbr: Use freeze based on availability +- !6134 v3 rootfs: Fix support for rootfstype= when root= is given +- rootfs: Fix support for rootfstype= when root= is given + +* Tue Apr 23 2024 Hongchen Zhang - 6.6.0-21.0.0.24 +- add LoongArch support + +* Tue Apr 23 2024 Hongchen Zhang - 6.6.0-21.0.0.23 +- exclude cpufreq.h and cpuidle.h from kernel-headers package + +* Sat Apr 20 2024 ZhangPeng - 6.6.0-21.0.0.22 +- !6201 v2 mm: some optimization about hugetlb and thp +- mm: filemap: try to enable THP for exec mapping +- mm/khugepaged: keep mm in mm_slot without MMF_DISABLE_THP check +- mm/khugepaged: bypassing unnecessary scans with MMF_DISABLE_THP check +- mm: mmap: no need to call khugepaged_enter_vma() for stack +- mm: remove VM_EXEC requirement for THP eligibility +- mm: thp_get_unmapped_area must honour topdown preference +- mm: huge_memory: don't force huge page alignment on 32 bit +- mm: mmap: map MAP_STACK to VM_NOHUGEPAGE +- mm: align larger anonymous mappings on THP boundaries +- fs/hugetlbfs/inode.c: mm/memory-failure.c: fix hugetlbfs hwpoison handling +- mm/hugetlb: have CONFIG_HUGETLB_PAGE select CONFIG_XARRAY_MULTI +- mm/filemap: remove hugetlb special casing in filemap.c +- mm/filemap: clarify filemap_fault() comments for not uptodate case +- mm: huge_memory: batch tlb flush when splitting a pte-mapped THP +- !6230 xarray: inline xas_descend to improve performance +- xarray: inline xas_descend to improve performance +- !5891 Fix several compilation warnings for hinic driver +- net/hinic: Fix several compilation warnings with aarch64-openEuler-linux toolchain +- !6244 arm64: enable CONFIG_ARM64_MPAM in openeuler_defconfig +- arm64: enable CONFIG_ARM64_MPAM in openeuler_defconfig +- !6105 fix some issues for arm64 machine check safe +- ACPI: APEI: handle synchronous exceptions in task work to send correct SIGBUS si_code +- mm: memory-failure: move return value documentation to function declaration +- ACPI: APEI: send SIGBUS to current task if synchronous memory error not recovered +- arm64: add machine check safe sysctl interface +- arm64: introduce copy_mc_to_kernel() implementation +- arm64: support copy_mc_[user]_highpage() +- arm64: Get rid of ARM64_HAS_NO_HW_PREFETCH +- mm/hwpoison: return -EFAULT when copy fail in copy_mc_[user]_highpage() +- arm64: add support for ARCH_HAS_COPY_MC +- Revert "arm64: add support for machine check error safe" +- Revert "arm64: add uaccess to machine check safe" +- Revert "mm/hwpoison: return -EFAULT when copy fail in copy_mc_[user]_highpage()" +- Revert "arm64: support copy_mc_[user]_highpage()" +- Revert "arm64: introduce copy_mc_to_kernel() implementation" +- Revert "arm64: add machine check safe sysctl interface" +- Revert "kasan: fix the compilation error for memcpy_mcs()" + +* Tue Apr 16 2024 Zheng Zengkai - 6.6.0-20.0.0.21 +- !6048 improve 3SNIC 910/920/930 NIC driver +- improve 3SNIC 910/920/930 NIC driver +- !5815 v2 Support NMI in the virtual machine +- KVM: arm64: vgic-v3: Handle traps of ICV_NMIAR1_EL1 +- arm64: Decouple KVM from CONFIG_ARM64_NMI +- KVM: arm64: Handle traps of ALLINT +- KVM: arm64: Allow GICv3.3 NMI if the host supports it +- KVM: arm64: vgic-v3: Don't inject an NMI if the vcpu doesn't have FEAT_NMI +- KVM: arm64: Don't trap ALLINT accesses if the vcpu has FEAT_NMI +- KVM: arm64: Allow userspace to control ID_AA64PFR1_EL1.NMI +- KVM: arm64: vgic-debug: Add the NMI field to the debug output +- KVM: arm64: vgic-v3: Add userspace selection for GICv3.3 NMI +- KVM: arm64: vgic-v3: Add support for GIC{D,R}_INMIR registers +- KVM: arm64: vgic-v3: Use the NMI attribute as part of the AP-list sorting +- KVM: arm64: vgic-v4: Propagate the NMI state into the GICv4.1 VSGI configuration +- KVM: arm64: vgic-v3: Make NMI priority RES0 +- KVM: arm64: vgic-v3: Allow the NMI state to make it into the LRs +- KVM: arm64: vgic-v3: Upgrade AP1Rn to 64bit. +- !5752 【OLK-6.6】Add Chengdu BeiZhongWangXin Technology N5/N6 Series Network Card Driver +- drivers: add Chengdu BeiZhongWangXin Technology N5/N6 Series Network Card Driver +- !5730 [OLK-6.6] Fix warnings for RNPGBEVF driver +- RNPGBEVF: NET: Fix wanrings +- !5726 [OLK-6.6] Fix warnings for RNPVF driver +- RNPVF: NET: Fix wanrings +- !5854 [OLK-6.6] Make Cluster Scheduling Configurable +- scheduler: Disable cluster scheduling by default +- scheduler: Add boot time enabling/disabling of cluster scheduling +- scheduler: Add runtime knob sysctl_sched_cluster +- scheduler: Create SDTL_SKIP flag to skip topology level +- !6068 mm: batch mm counter updating in filemap_map_pages() +- mm: filemap: batch mm counter updating in filemap_map_pages() +- mm: move mm counter updating out of set_pte_range() +- !5931 irqchip/gicv3-its: Add workaround for hip09 ITS erratum 162100801 +- irqchip/gicv3-its: Add workaround for hip09 ITS erratum 162100801 +- !5678 v2 KVM: arm64: Translate logic cluster id to physical cluster id when updating lsudvmbm +- KVM: arm64: Translate logic cluster id to physical cluster id when updating lsudvmbm +- !5972 Perf-related bugfix +- docs: perf: Fix build warning of hisi-pcie-pmu.rst +- drivers/perf: hisi_pcie: Merge find_related_event() and get_event_idx() +- drivers/perf: hisi_pcie: Relax the check on related events +- drivers/perf: hisi_pcie: Check the target filter properly +- drivers/perf: hisi_pcie: Add more events for counting TLP bandwidth +- drivers/perf: hisi_pcie: Fix incorrect counting under metric mode +- drivers/perf: hisi_pcie: Introduce hisi_pcie_pmu_get_event_ctrl_val() +- drivers/perf: hisi_pcie: Rename hisi_pcie_pmu_{config,clear}_filter() +- drivers/perf: hisi: Enable HiSilicon Erratum 162700402 quirk for HIP09 +- docs: perf: Update usage for target filter of hisi-pcie-pmu +- !6063 RDMA/hns: Some bugfixes and cleanups +- RDMA/hns: Fix long waiting cmd event when reset +- RDMA/hns: Fix the overflow risk of hem_list_calc_ba_range() +- RDMA/hns: Fix simultaneous reset and resource deregistration +- RDMA/hns: Fix cpu stuck by printings during reset +- RDMA/hns: Fix missing capacities in query_device() +- RDMA/hns: Fix missing resetting notify +- RDMA/hns: Remove extra blank line in get_sge_num_from_max_inl_data() +- RDMA/hns: Use complete parentheses in macros +- RDMA/hns: fix iommu_map_sg() failed when MR bigger than 4G +- !6069 RDMA/hns: support roh +- RDMA/hns: Support RDMA_CM in ROH mode +- RDMA/hns: Support for ROH +- RDMA/hns: Add new device ID +- !6008 locking/osq_lock: Avoid false sharing in optimistic_spin_node +- locking/osq_lock: Avoid false sharing in optimistic_spin_node +- !5774 irqdomain: Fix driver re-inserting failures when IRQs not being freed +- irqdomain: Fix driver re-inserting failures when IRQs not being freed +- !5709 【OLK-6.6】configs: arm64: Enable CONFIG_DLM +- configs: arm64: Enable CONFIG_DLM +- !5971 RDMA/hns: Support hns roce DCA mode +- RDMA/hns: Fix DCA's dependence on ib_uverbs +- RDMA/hns: Fixes concurrent ressetting and post_recv in DCA mode +- RDMA/hns: Optimize user DCA perfermance by sharing DCA status +- RDMA/hns: Add debugfs support for DCA +- RDMA/hns: Add DCA support for kernel space +- RDMA/hns: Add method to query WQE buffer's address +- RDMA/hns: Add method to detach WQE buffer +- RDMA/hns: Setup the configuration of WQE addressing to QPC +- RDMA/hns: Add method for attaching WQE buffer +- RDMA/hns: Configure DCA mode for the userspace QP +- RDMA/hns: Add method for shrinking DCA memory pool +- RDMA/hns: Introduce DCA for RC QP + +* Fri Apr 12 2024 Jin Lun - 6.6.0-19.0.0.20 +- Remove PGP certificates. +- Optimize the signing process, if the project has no permission + to send sign request, use the kernel native signing. + +* Wed Apr 10 2024 ZhangPeng - 6.6.0-19.0.0.19 +- !5877 optimize eevdf scheduler +- sched/eevdf: Skip eligibility check for current entity during wakeup preemption +- sched/eevdf: O(1) fastpath for task selection +- sched/eevdf: Sort the rbtree by virtual deadline +- !5922 Some fixes and cleanups for SAS +- Revert "scsi: hisi_sas: Disable SATA disk phy for severe I_T nexus reset failure" +- scsi: hisi_sas: Add slave_destroy interface for v3 hw +- scsi: hisi_sas: Modify the deadline for ata_wait_after_reset() +- scsi: libsas: Allocation SMP request is aligned to ARCH_DMA_MINALIGN +- scsi: libsas: Add a helper sas_get_sas_addr_and_dev_type() +- scsi: libsas: Fix disk not being scanned in after being removed +- scsi: hisi_sas: Remove redundant checks for automatic debugfs dump +- scsi: hisi_sas: Check usage count only when the runtime PM status is RPM_SUSPENDING +- scsi: hisi_sas: Handle the NCQ error returned by D2H frame +- scsi: hisi_sas: Remove hisi_hba->timer for v3 hw +- scsi: hisi_sas: Check whether debugfs is enabled before removing or releasing it +- scsi: hisi_sas: Fix a deadlock issue related to automatic dump +- scsi: hisi_sas: Allocate DFX memory during dump trigger +- scsi: hisi_sas: Directly call register snapshot instead of using workqueue +- !5546 support 3snic NIC +- support 3SNIC 910/920/930 NIC +- !5869 KVM: arm64: vgic-its: use vgic_get_irq_kref() before vgic_put_irq() +- KVM: arm64: vgic-its: use vgic_get_irq_kref() before vgic_put_irq() +- !5878 ima:Dont check xattr when loading digest lists +- ima:Dont check xattr when loading digest lists +- !5800 firmware: arm_sdei: Move sdei_cpuhp_up/down() before lockup_detector_online_cpu() +- firmware: arm_sdei: Move sdei_cpuhp_up/down() before lockup_detector_online_cpu() +- !3175 [OLK-6.6] x86/tsc: Make cur->adjusted values in package#1 to be the same +- x86/tsc: Make cur->adjusted values in package#1 to be the same +- !5022 [devel-6.6] perf/x86/zhaoxin/uncore: Add KX-7000 support +- perf/x86/zhaoxin/uncore: Add KX-7000 support +- !5652 [OLK-6.6] i2c: zhaoxin: update support for Zhaoxin I2C controller +- i2c: zhaoxin: update support for Zhaoxin I2C controller +- !4475 [OLK-6.6] Update zhaoxin cputemp driver with using the same MSR uniformly +- Update zhaoxin cputemp driver with using the same MSR uniformly +- !5813 [intel]OLK-tdx-guest-configs-6.6 +- Enable Intel TDX guest as kernel module +- !5723 vfio/migration: some bugfix +- hisi_acc_vfio_pci: obtain the mailbox configuration at one time +- vfio/migration: remove unused local variable +- vfio/migration: bugfix cache write-back issue +- vfio/migration: add eq and aeq interruption restore +- vfio/migration: bugfix some driver code +- vfio/migration: added map length page alignment +- !5707 [OLK-6.6] Fix warnings for RNPGBE driver +- RNPGBE: NET: Fix wanrings +- !5659 [OLK-6.6] Fix warnings for RNP driver +- RNP: Fix warnings + +* Mon Apr 08 2024 Ren Zhijie - 6.6.0-18.0.0.18 +- add support for arch ppc64le + +* Mon Apr 08 2024 Zheng Zengkai - 6.6.0-18.0.0.17 +- !5768 resctrl: fix undefined reference to lockdep_is_cpus_held() +- fs/resctrl: Move rdtgroup_setup_default() out of init.text section +- resctrl: fix undefined reference to lockdep_is_cpus_held() +- !5769 Revert "KVM: arm64: Disable MPAM visibility by default, and handle traps" +- Revert "KVM: arm64: Disable MPAM visibility by default, and handle traps" +- !5744 Backport maple_tree: iterator state changes +- lib/maple_tree.c: fix build error due to hotfix alteration +- maple_tree: mtree_range_walk() clean up +- maple_tree: don't find node end in mtree_lookup_walk() +- maple_tree: use maple state end for write operations +- maple_tree: remove mas_searchable() +- maple_tree: separate ma_state node from status +- maple_tree: clean up inlines for some functions +- maple_tree: use cached node end in mas_destroy() +- maple_tree: use cached node end in mas_next() +- maple_tree: add end of node tracking to the maple state +- maple_tree: move debug check to __mas_set_range() +- maple_tree: make mas_erase() more robust +- maple_tree: remove unnecessary default labels from switch statements +- !5725 ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs +- ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs + +* Sun Apr 07 2024 Zheng Zengkai - 6.6.0-17.0.0.16 +- !5695 v2 Disable OLK-6.6 configs +- arm64: configs: Disable PROBE_EVENTS_BTF_ARGS +- x86: configs: Disable PROBE_EVENTS_BTF_ARGS +- x86: configs: Disable X86_KERNEL_IBT +- x86: configs: Disable CRASH_HOTPLUG +- !5733 fix port vlan filter not disabled problem in dynamic vlan mode +- net: hns3: fix port vlan filter not disabled problem in dynamic vlan mode +- !5734 arch/mm/fault: accelerate pagefault when badaccess +- x86: mm: accelerate pagefault when badaccess +- arm64: mm: accelerate pagefault when VM_FAULT_BADACCESS +- !5657 Backport slub performance optimization +- mm/slub: remove unused parameter in next_freelist_entry() +- mm/slub: remove full list manipulation for non-debug slab +- mm/slub: directly load freelist from cpu partial slab in the likely case +- slub: Update frozen slabs documentations in the source +- slub: Rename all *unfreeze_partials* functions to *put_partials* +- slub: Optimize deactivate_slab() +- slub: Delay freezing of partial slabs +- slub: Introduce freeze_slab() +- slub: Prepare __slab_free() for unfrozen partial slab out of node partial list +- slub: Keep track of whether slub is on the per-node partial list +- slub: Change get_partial() interfaces to return slab +- slub: Reflow ___slab_alloc() +- !5699 sr9800: Add check for usbnet_get_endpoints +- sr9800: Add check for usbnet_get_endpoints + +* Tue Apr 02 2024 Zheng Zengkai - 6.6.0-16.0.0.15 +- !5647 hisilicon - some bugfix and cleanup +- crypto: hisilicon/sec2: fix memory use-after-free issue +- crypto: hisilicon/qm - hardware error does not reset during binding/unbinding +- crypto: hisilicon/qm - check device status before sending mailbox +- crypto: hisilicon/qm - mask error bit before flr +- crypto: hisilicon/qm - fix the pf2vf timeout when global reset +- crypto: hisilicon/qm - obtain the mailbox configuration at one time +- crypto: hisilicon/hpre - mask cluster timeout error +- crypto: hisilicon/qm - disable same error report before resetting +- crypto: hisilicon/qm - modify interrupt processing resource application +- crypto: hisilicon/qm - reset device before enabling it +- openeuler_defconfig: enable HISI_ACC_VFIO_PCI=m +- Revert "openeuler_defconfig: enable HISI_ACC_VFIO_PCI=m" +- !5509 ext4: Validate inode pa before using preallocation blocks +- ext4: Validate inode pa before using preallocation blocks +- !5630 scsi: sd: try more retries of START_STOP when resuming scsi device +- scsi: sd: try more retries of START_STOP when resuming scsi device +- !5561 roh: backport roh driver feature support +- roh/hns3: Fix the processing flow of ROH CMDq during the reset process. +- roh/core: Synchronously update the mac address of the vlan device when configuring the vlan device ip +- roh/hns3: Fix ROH multi-BD cmdq issue +- roh/hns3: Add support for roh dfx(debugfs) +- roh/hns3: Add support for roh reset +- roh/core: Add support for inetaddr notifier in roh/core +- roh/hns3: Add support for roh abnormal interruption +- roh/core: Add roh device sysfs node +- roh/hns3: Add ROH cmdq interface support +- roh/hns3: Add ROH hns3 driver and register a ROH device +- roh/core: Add ROH device driver +- net: hns3: add support for ROH reset +- net: hns3: intercept invalid MAC address setting in ROH +- !5703 openeuler_defconfig: Disable CONFIG_PREEMPT_DYNAMIC for x86 +- openeuler_defconfig: Disable CONFIG_PREEMPT_DYNAMIC for x86 +- !5513 [OLK-6.6] SCSI: SSSRAID: Support 3SNIC 3S5XX serial RAID/HBA controllers +- SCSI: SSSRAID: Support 3SNIC 3S5XX serial RAID/HBA controllers +- !5582 [OLK-6.6]Open CONFIG_LZ4_COMPRESS option for x86_64 architecture +- Open CONFIG_LZ4_COMPRESS option for x86_64 architecture +- !5688 v3 Optimize compaction +- mm/compaction: optimize >0 order folio compaction with free page split. +- mm/compaction: add support for >0 order folio memory compaction. +- mm/compaction: enable compacting >0 order folios. +- mm/page_alloc: remove unused fpi_flags in free_pages_prepare() +- mm/compaction: introduce NR_PAGE_ORDERS and MAX_PAGE_ORDER +- mm: compaction: limit the suitable target page order to be less than cc->order +- mm: compaction: update the cc->nr_migratepages when allocating or freeing the freepages +- mm: compaction: avoid fast_isolate_freepages blindly choose improper pageblock +- mm: add page_rmappable_folio() wrapper +- mm: page_alloc: check the order of compound page even when the order is zero +- mm/compaction: factor out code to test if we should run compaction for target order +- mm/compaction: improve comment of is_via_compact_memory +- mm/compaction: remove repeat compact_blockskip_flush check in reset_isolation_suitable +- mm/compaction: correctly return failure with bogus compound_order in strict mode +- mm/compaction: call list_is_{first}/{last} more intuitively in move_freelist_{head}/{tail} +- mm/compaction: use correct list in move_freelist_{head}/{tail} +- !5655 add steal time software breakpoint pv ipi support for loongarch kvm +- LoongArch: Add steal time support in guest side +- LoongArch: KVM: Add steal time support in kvm side +- irqchip/loongson-eiointc: Add virt extension support +- LoongArch: KVM: Add software breakpoint support +- Documentation: KVM: Add hypercall for LoongArch +- LoongArch: Add pv ipi support on guest kernel side +- LoongArch: KVM: Add pv ipi support on kvm side +- LoongArch: KVM: Add vcpu search support from physical cpuid +- LoongArch: KVM: Add cpucfg area for kvm hypervisor +- LoongArch: KVM: Add hypercall instruction emulation support +- LoongArch/smp: Refine some ipi functions on LoongArch platform +- !5653 arm64: Enable hardware NMI for perf events NMI +- arm64: Enable hardware NMI for perf events NMI +- !5667 configs: arm64: Enable CONFIG_ACPI_AGDI and CONFIG_ACPI_FFH +- configs: arm64: Enable CONFIG_ACPI_AGDI and CONFIG_ACPI_FFH +- !5669 disable CONFIG_CMDLINE_FROM_BOOTLOADER CONFIG_INITRAMFS_PRESERVE_MTIME in 6.6 +- configs: disable CONFIG_CMDLINE_FROM_BOOTLOADER CONFIG_INITRAMFS_PRESERVE_MTIME in 6.6 +- !5663 arm64: transparent contiguous PTEs for user mappings +- arm64: configs: enable ARM64_CONTPTE +- tools/mm: add thpmaps script to dump THP usage info +- mm: make folio_pte_batch available outside of mm/memory.c +- arm64/mm: automatically fold contpte mappings +- arm64/mm: __always_inline to improve fork() perf +- arm64/mm: implement pte_batch_hint() +- mm: add pte_batch_hint() to reduce scanning in folio_pte_batch() +- arm64/mm: implement new [get_and_]clear_full_ptes() batch APIs +- arm64/mm: implement new wrprotect_ptes() batch API +- arm64/mm: wire up PTE_CONT for user mappings +- arm64/mm: dplit __flush_tlb_range() to elide trailing DSB +- arm64/mm: new ptep layer to manage contig bit +- arm64/mm: convert ptep_clear() to ptep_get_and_clear() +- arm64/mm: convert set_pte_at() to set_ptes(..., 1) +- arm64/mm: convert READ_ONCE(*ptep) to ptep_get(ptep) +- mm: tidy up pte_next_pfn() definition +- x86/mm: convert pte_next_pfn() to pte_advance_pfn() +- arm64/mm: convert pte_next_pfn() to pte_advance_pfn() +- mm: introduce pte_advance_pfn() and use for pte_next_pfn() +- mm: thp: batch-collapse PMD with set_ptes() +- mm: clarify the spec for set_ptes() +- mm: memory: move mem_cgroup_charge() into alloc_anon_folio() +- mm: memory: use folio_prealloc() in wp_page_copy() +- mm: memory: use a folio in do_cow_fault() +- mm: memory: rename page_copy_prealloc() to folio_prealloc() +- !5662 v4 Introduce dynamic pool feature part 2 +- mm/dynamic_pool: Wrap some core functions with dpool prefix +- mm/dynamic_pool: disable irq for dynamic_pool lock +- mm/dynamic_pool: don't set subpool for page from dynamic pool +- mm/dynamic_pool: skip unexpected migration +- mm/mem_reliable: Fallback to dpool if reliable memory is not enough +- mm/mem_reliable: Treat page from dhugetlb pool as unreliable page +- mm/dynamic_pool: Stop alloc reliable page from dynamic pool +- !5621 irqchip/gic-v3: Fix a system stall when using pseudo NMI with CONFIG_ARM64_NMI closed +- irqchip/gic-v3: Fix a system stall when using pseudo NMI with CONFIG_ARM64_NMI closed +- !5656 v3 mm: backport fork/unmap/zap optimize +- mm/memory: fix missing pte marker for !page on pte zaps +- mm/memory: optimize unmap/zap with PTE-mapped THP +- mm/mmu_gather: improve cond_resched() handling with large folios and expensive page freeing +- mm/mmu_gather: add __tlb_remove_folio_pages() +- mm/mmu_gather: add tlb_remove_tlb_entries() +- mm/mmu_gather: define ENCODED_PAGE_FLAG_DELAY_RMAP +- mm/mmu_gather: pass "delay_rmap" instead of encoded page to __tlb_remove_page_size() +- mm/memory: factor out zapping folio pte into zap_present_folio_pte() +- mm/memory: further separate anon and pagecache folio handling in zap_present_pte() +- mm/memory: handle !page case in zap_present_pte() separately +- mm/memory: factor out zapping of present pte into zap_present_pte() +- mm/memory: ignore writable bit in folio_pte_batch() +- mm/memory: ignore dirty/accessed/soft-dirty bits in folio_pte_batch() +- mm/memory: optimize fork() with PTE-mapped THP +- mm/memory: pass PTE to copy_present_pte() +- mm/memory: factor out copying the actual PTE in copy_present_pte() +- powerpc/mm: use pte_next_pfn() in set_ptes() +- arm/mm: use pte_next_pfn() in set_ptes() +- mm/pgtable: make pte_next_pfn() independent of set_ptes() +- sparc/pgtable: define PFN_PTE_SHIFT +- s390/pgtable: define PFN_PTE_SHIFT +- riscv/pgtable: define PFN_PTE_SHIFT +- powerpc/pgtable: define PFN_PTE_SHIFT +- nios2/pgtable: define PFN_PTE_SHIFT +- arm/pgtable: define PFN_PTE_SHIFT +- arm64/mm: make set_ptes() robust when OAs cross 48-bit boundary +- arm64: Mark the 'addr' argument to set_ptes() and __set_pte_at() as unused +- arm64/mm: Hoist synchronization out of set_ptes() loop +- mm: convert mm_counter_file() to take a folio +- mm: convert mm_counter() to take a folio +- mm: convert to should_zap_page() to should_zap_folio() +- mm: use pfn_swap_entry_folio() in copy_nonpresent_pte() +- mm: use pfn_swap_entry_to_folio() in zap_huge_pmd() +- mm: use pfn_swap_entry_folio() in __split_huge_pmd_locked() +- s390: use pfn_swap_entry_folio() in ptep_zap_swap_entry() +- mprotect: use pfn_swap_entry_folio +- mm: add pfn_swap_entry_folio() + +* Tue Apr 2 2024 Jin Lun - 6.6.0-15.0.0.14 +- Support generating moudle/kernel signature with openEuler signature platform + +* Sat Mar 30 2024 Liu Jian - 6.6.0-15.0.0.13 +- And net-acc tool to kernel-tools. + +* Fri Mar 29 2024 Zheng Zengkai - 6.6.0-15.0.0.12 +- !5470 [OLK-6.6] Add support for Mucse Virtual Function Network Adapter(N500/n210) +- drivers: initial support for rnpgbevf drivers from Mucse Technology +- !3164 [OLK-6.6] Fix CRC32C instruction low performance issue +- crypto: x86/crc32c-intel - Don't match some Zhaoxin CPUs +- !5547 Synchronizing upstream patch +- LoongArch: KVM: Set reserved bits as zero in CPUCFG +- LoongArch: KVM: Do not restart SW timer when it is expired +- LoongArch: KVM: Start SW timer only when vcpu is blocking +- irqchip/loongson-eiointc: Remove explicit interrupt affinity restore on resume +- irqchip/loongson-eiointc: Skip handling if there is no pending irq +- !3182 [OLK-6.6] Add support for Zhaoxin GMI SM2 Secure Hash algorithm +- configs: add CONFIG_CRYPTO_SM2_ZHAOXIN_GMI to m +- Add support for Zhaoxin GMI SM2 Secure Hash algorithm +- !5578 SCSI: hisi_raid: support SPxxx serial RAID/HBA controllers +- SCSI: hisi_raid: support SPxxx serial RAID/HBA controllers +- !5641 userfaultfd: early return in dup_userfaultfd() +- userfaultfd: early return in dup_userfaultfd() +- !5629 v3 Mitigate a vmap lock contention +- mm: vmalloc: refactor vmalloc_dump_obj() function +- mm: vmalloc: improve description of vmap node layer +- mm: vmalloc: add a shrinker to drain vmap pools +- mm: vmalloc: set nr_nodes based on CPUs in a system +- mm: vmalloc: support multiple nodes in vmallocinfo +- mm: vmalloc: support multiple nodes in vread_iter +- mm: vmalloc: add a scan area of VA only once +- mm: vmalloc: offload free_vmap_area_lock lock +- mm: vmalloc: remove global purge_vmap_area_root rb-tree +- mm/vmalloc: remove vmap_area_list +- mm: vmalloc: remove global vmap_area_root rb-tree +- mm: vmalloc: move vmap_init_free_space() down in vmalloc.c +- mm: vmalloc: rename adjust_va_to_fit_type() function +- mm: vmalloc: add va_alloc() helper +- mm: Introduce vmap_page_range() to map pages in PCI address space +- mm: Introduce VM_SPARSE kind and vm_area_[un]map_pages(). +- mm: Enforce VM_IOREMAP flag and range in ioremap_page_range. +- mm/vmalloc: fix the unchecked dereference warning in vread_iter() +- !5609 Adding Huawei BMA driver +- configs: add config BMA to config files +- Huawei BMA: Adding Huawei BMA driver: cdev_veth_drv +- Huawei BMA: Adding Huawei BMA driver: host_kbox_drv +- Huawei BMA: Adding Huawei BMA driver: host_veth_drv +- Huawei BMA: Adding Huawei BMA driver: host_cdev_drv +- Huawei BMA: Adding Huawei BMA driver: host_edma_drv +- !5613 mm: backport rmap interface overhaul +- mm/memory: fix folio_set_dirty() vs. folio_mark_dirty() in zap_pte_range() +- mm/huge_memory: fix folio_set_dirty() vs. folio_mark_dirty() +- mm/rmap: silence VM_WARN_ON_FOLIO() in __folio_rmap_sanity_checks() +- mm: remove one last reference to page_add_*_rmap() +- mm/rmap: rename COMPOUND_MAPPED to ENTIRELY_MAPPED +- mm: convert page_try_share_anon_rmap() to folio_try_share_anon_rmap_[pte|pmd]() +- mm/rmap: remove page_try_dup_anon_rmap() +- mm/memory: page_try_dup_anon_rmap() -> folio_try_dup_anon_rmap_pte() +- mm/huge_memory: page_try_dup_anon_rmap() -> folio_try_dup_anon_rmap_pmd() +- mm/rmap: introduce folio_try_dup_anon_rmap_[pte|ptes|pmd]() +- mm/rmap: convert page_dup_file_rmap() to folio_dup_file_rmap_[pte|ptes|pmd]() +- mm/rmap: remove page_remove_rmap() +- Documentation: stop referring to page_remove_rmap() +- mm: userswap: page_remove_rmap() -> folio_remove_rmap_pte() +- mm/rmap: page_remove_rmap() -> folio_remove_rmap_pte() +- mm/migrate_device: page_remove_rmap() -> folio_remove_rmap_pte() +- mm/memory: page_remove_rmap() -> folio_remove_rmap_pte() +- mm/ksm: page_remove_rmap() -> folio_remove_rmap_pte() +- mm/khugepaged: page_remove_rmap() -> folio_remove_rmap_pte() +- mm/huge_memory: page_remove_rmap() -> folio_remove_rmap_pmd() +- kernel/events/uprobes: page_remove_rmap() -> folio_remove_rmap_pte() +- mm/rmap: introduce folio_remove_rmap_[pte|ptes|pmd]() +- mm/rmap: remove RMAP_COMPOUND +- mm/rmap: remove page_add_anon_rmap() +- mm/memory: page_add_anon_rmap() -> folio_add_anon_rmap_pte() +- mm/swapfile: page_add_anon_rmap() -> folio_add_anon_rmap_pte() +- mm/ksm: page_add_anon_rmap() -> folio_add_anon_rmap_pte() +- mm/migrate: page_add_anon_rmap() -> folio_add_anon_rmap_pte() +- mm/huge_memory: page_add_anon_rmap() -> folio_add_anon_rmap_pmd() +- mm/huge_memory: batch rmap operations in __split_huge_pmd_locked() +- mm/rmap: introduce folio_add_anon_rmap_[pte|ptes|pmd]() +- mm/rmap: factor out adding folio mappings into __folio_add_rmap() +- mm/rmap: remove page_add_file_rmap() +- mm/userfaultfd: page_add_file_rmap() -> folio_add_file_rmap_pte() +- mm/migrate: page_add_file_rmap() -> folio_add_file_rmap_pte() +- mm/huge_memory: page_add_file_rmap() -> folio_add_file_rmap_pmd() +- mm/memory: page_add_file_rmap() -> folio_add_file_rmap_[pte|pmd]() +- mm/rmap: convert folio_add_file_rmap_range() into folio_add_file_rmap_[pte|ptes|pmd]() +- mm/rmap: add hugetlb sanity checks for anon rmap handling +- mm/rmap: introduce and use hugetlb_try_share_anon_rmap() +- mm/rmap: introduce and use hugetlb_try_dup_anon_rmap() +- mm/rmap: introduce and use hugetlb_add_file_rmap() +- mm/rmap: introduce and use hugetlb_remove_rmap() +- mm/rmap: rename hugepage_add* to hugetlb_add* +- mm/khugepaged: convert collapse_pte_mapped_thp() to use folios +- mm/khugepaged: convert alloc_charge_hpage() to use folios +- mm/khugepaged: convert is_refcount_suitable() to use folios +- mm/khugepaged: convert hpage_collapse_scan_pmd() to use folios +- mm/khugepaged: convert __collapse_huge_page_isolate() to use folios +- !5543 v2 locking/qspinlock: Add CNA support for ARM64 +- config/arm64: Enable numa aware qspinlock by default +- locking/qspinlock: Add CNA support for ARM64 without pvspinlock +- !5555 v2 ACPI/arm64: add support for virtual cpu hotplug +- arm64/psci: Add undefined error message printing for psci_x_cpu_on +- cpumask: Add enabled cpumask for present CPUs that can be brought online +- ACPI: Add _OSC bits to advertise OS support for toggling CPU present/enabled +- arm64: document virtual CPU hotplug's expectations +- ACPI: processor: Only call arch_unregister_cpu() if HOTPLUG_CPU is selected +- ACPI: add support to register CPUs based on the _STA enabled bit +- arm64: psci: Ignore DENIED CPUs +- irqchip/gic-v3: Add support for ACPI's disabled but 'online capable' CPUs +- irqchip/gic-v3: Don't return errors from gic_acpi_match_gicc() +- ACPICA: Add new MADT GICC flags fields +- arm64: acpi: Move get_cpu_for_acpi_id() to a header +- ACPI: Warn when the present bit changes but the feature is not enabled +- ACPI: Check _STA present bit before making CPUs not present +- ACPI: convert acpi_processor_post_eject() to use IS_ENABLED() +- ACPI: Add post_eject to struct acpi_scan_handler for cpu hotplug +- ACPI: Rename acpi_processor_hotadd_init and remove pre-processor guards +- ACPI: Move acpi_bus_trim_one() before acpi_scan_hot_remove() +- ACPI: Rename ACPI_HOTPLUG_CPU to include 'present' +- ACPI: processor: Register all CPUs from acpi_processor_get_info() +- ACPI: processor: Register CPUs that are online, but not described in the DSDT +- ACPI: processor: Add support for processors described as container packages +- ACPI: Only enumerate enabled (or functional) devices +- !5461 [OLK-6.6] Add support for Mucse Virtual Function Network Adapter(N10) +- drivers: initial support for rnpvf drivers from Mucse Technology +- !5526 Intel: Backport QuickAssist Technology(QAT) in-tree driver +- Enable Intel QAT_4XXX as kernel module +- crypto: qat - make ring to service map common for QAT GEN4 +- crypto: qat - fix ring to service map for dcc in 420xx +- crypto: qat - fix ring to service map for dcc in 4xxx +- crypto: qat - fix comment structure +- crypto: qat - remove unnecessary description from comment +- crypto: qat - remove double initialization of value +- crypto: qat - avoid division by zero +- crypto: qat - removed unused macro in adf_cnv_dbgfs.c +- crypto: qat - remove unused macros in qat_comp_alg.c +- crypto: qat - uninitialized variable in adf_hb_error_inject_write() +- Documentation: qat: fix auto_reset section +- crypto: qat - resolve race condition during AER recovery +- crypto: qat - change SLAs cleanup flow at shutdown +- crypto: qat - improve aer error reset handling +- crypto: qat - limit heartbeat notifications +- crypto: qat - add auto reset on error +- crypto: qat - add fatal error notification +- crypto: qat - re-enable sriov after pf reset +- crypto: qat - update PFVF protocol for recovery +- crypto: qat - disable arbitration before reset +- crypto: qat - add fatal error notify method +- crypto: qat - add heartbeat error simulator +- crypto: qat - use kcalloc_node() instead of kzalloc_node() +- crypto: qat - avoid memcpy() overflow warning +- crypto: qat - fix arbiter mapping generation algorithm for QAT 402xx +- crypto: qat - generate dynamically arbiter mappings +- crypto: qat - add support for ring pair level telemetry +- crypto: qat - add support for device telemetry +- crypto: qat - add admin msgs for telemetry +- crypto: qat - include pci.h for GET_DEV() +- crypto: qat - add support for 420xx devices +- crypto: qat - move fw config related structures +- crypto: qat - relocate portions of qat_4xxx code +- crypto: qat - change signature of uof_get_num_objs() +- crypto: qat - relocate and rename get_service_enabled() +- crypto: qat - add NULL pointer check +- crypto: qat - fix mutex ordering in adf_rl +- crypto: qat - fix error path in add_update_sla() +- crypto: qat - add sysfs_added flag for rate limiting +- crypto: qat - add sysfs_added flag for ras +- crypto: qat - prevent underflow in rp2srv_store() +- units: add missing header +- seq_file: add helper macro to define attribute for rw file +- crypto: qat - move adf_cfg_services +- crypto: qat - add num_rps sysfs attribute +- crypto: qat - add rp2svc sysfs attribute +- crypto: qat - add rate limiting sysfs interface +- crypto: qat - add rate limiting feature to qat_4xxx +- crypto: qat - add retrieval of fw capabilities +- crypto: qat - add bits.h to icp_qat_hw.h +- units: Add BYTES_PER_*BIT +- crypto: qat - move admin api +- crypto: qat - count QAT GEN4 errors +- crypto: qat - add error counters +- crypto: qat - add handling of errors from ERRSOU3 for QAT GEN4 +- crypto: qat - add adf_get_aram_base() helper function +- crypto: qat - add handling of compression related errors for QAT GEN4 +- crypto: qat - add handling of errors from ERRSOU2 for QAT GEN4 +- crypto: qat - add reporting of errors from ERRSOU1 for QAT GEN4 +- crypto: qat - add reporting of correctable errors for QAT GEN4 +- crypto: qat - add infrastructure for error reporting +- crypto: qat - add cnv_errors debugfs file +- crypto: qat - add pm_status debugfs file +- crypto: qat - refactor included headers +- crypto: qat - add namespace to driver +- crypto: qat - Remove zlib-deflate +- crypto: qat - Annotate struct adf_fw_counters with __counted_by +- crypto: qat - do not shadow error code +- crypto: qat - refactor deprecated strncpy +- crypto: qat - Use list_for_each_entry() helper +- Documentation: ABI: debugfs-driver-qat: fix fw_counters path + +* Thu Mar 28 2024 Bing Xia - 6.6.0-14.0.0.11 +- perf: add CoreSight trace component support on aarch64 platform + +* Wed Mar 27 2024 Zheng Zengkai - 6.6.0-14.0.0.10 +- !5524 [OLK-6.6] fix 0day bugs reported by CI robot for Mont-TSSE +- fix 0 day bugs for Mont-TSSE Driver +- !5284 [OLK-6.6] fs/address_space: move i_mmap_rwsem to mitigate a false sharing with i_mmap. +- fs/address_space: move i_mmap_rwsem to mitigate a false sharing with i_mmap. +- !5280 Add Huawei Intelligent Network Card Driver: hinic3 +- net/hinic3: add huawei/hinic3 driver +- !5179 Update Huawei Intelligent Network Card Driver: hinic +- net/hinic: Update Huawei Intelligent Network Card Driver: hinic +- !5523 enable openeuler_defconfig HISI_ACC_VFIO_PCI=m +- openeuler_defconfig: enable HISI_ACC_VFIO_PCI=m +- !5529 arch/powerpc: open BTF relevant configs in openuler defconfig +- arch/powerpc: open BTF relevant configs in openuler defconfig +- !5541 RDMA/hns: Backport bugfixes +- RDMA/hns: Refactor hns_roce_alloc_ucontext() +- RDMA/hns: Fix missing reset notification by user space driver +- RDMA/hns: Kernel notify usr space to stop ring db +- RDMA/hns: Support flexible wqe buffer page size +- !5464 net: hns3: backport some driver feature enhancement +- net: hns3: default select PAGE_POOL_STATS +- net: hns3: support set/get VxLAN rule of rx flow director by ethtool +- net: ethtool: add VxLAN to the NFC API +- net: hns3: add support for ROH ras +- net: hns3: fix bug for init roh client instance +- net: hns3: HNAE3 framework add support for ROH client +- net: hns3: add support handling tx dhcp packets for ROH +- net: hns3: support arp proxy +- net: hns3: add arp proxy switch in ethtool +- net: hns3: support tc limit rate +- net: hns3: support tc command with max rate parameter +- net: hns3: add ROH MAC type definitions and support query MAC type +- net: hns3: Add support for some CMIS transceiver modules +- net: sfp: Synchronize some CMIS transceiver modules from ethtool +- net: hns3: add command queue trace for hns3 +- net: hns3: dump more reg info based on ras mod +- net: hns3: add support for page_pool_get_stats +- net: hns3: add support to query scc version by devlink info +- net: hns3: correct the logic of hclge_sync_vf_qb_mode() +- net: hns3: add support for FD counter +- net: hns3: allocate fd counter for queue bonding +- net: hns3: refactor the debugfs for dumping FD tcam +- net: hns3: add queue bonding mode support for VF +- net: hns3: add support for queue bonding mode of flow director +- !5426 BTC's bugfix for openeuler OLK-6.6 +- ipmi: Add erratum 162102203 config to enable workaround for SMS message processing timeout +- ipmi: Errata workaround to prevent SMS message processing timeout +- !5049 [OLK-6.6]Add pcie acs and no-bus-reset quirk for mucse Nics +- Add pcie acs and no-bus-reset quirk for mucse Nics +- !5354 iommu/arm-smmu-v3: Disable ECMDQ before reset +- iommu/arm-smmu-v3: Disable ECMDQ before reset +- !5061 [OLK-6.6] riscv: Update openeuler_defconfig to support sg2042 SoC +- riscv: Update openeuler_defconfig to support sg2042 SoC +- !5427 crypto/trng: Remove the automatic loading of the hisi_trng driver +- crypto/trng: Remove the automatic loading of the hisi_trng driver +- crypto: hisilicon/trng - use %u to print u32 variables +- !5492 Backport Introduce __mt_dup() to improve the performance of fork() +- fork: use __mt_dup() to duplicate maple tree in dup_mmap() +- maple_tree: preserve the tree attributes when destroying maple tree +- maple_tree: update check_forking() and bench_forking() +- maple_tree: skip other tests when BENCH is enabled +- maple_tree: update the documentation of maple tree +- maple_tree: add test for mtree_dup() +- radix tree test suite: align kmem_cache_alloc_bulk() with kernel behavior. +- maple_tree: introduce interfaces __mt_dup() and mtree_dup() +- maple_tree: introduce {mtree,mas}_lock_nested() +- maple_tree: add mt_free_one() and mt_attr() helpers +- radix tree test suite: fix allocation calculation in kmem_cache_alloc_bulk() +- !5334 v4 iommu/iova: avoid softlockup in fq_flush_timeout +- iommu/iova: avoid softlockup in fq_flush_timeout +- !5412 [OLK-6.6] perf/x86/amd: Miscellaneous fixes +- perf vendor events amd: Fix Zen 4 cache latency events +- perf/x86/amd/lbr: Discard erroneous branch entries +- perf/x86/amd/core: Avoid register reset when CPU is dead +- !5376 Bluetooth: rfcomm: Fix null-ptr-deref in rfcomm_check_security +- Bluetooth: rfcomm: Fix null-ptr-deref in rfcomm_check_security + +* Fri Mar 22 2024 Zheng Zengkai - 6.6.0-13.0.0.9 +- !5424 block: Fix iterating over an empty bio with bio_for_each_folio_all +- block: Fix iterating over an empty bio with bio_for_each_folio_all +- !5425 nbd: always initialize struct msghdr completely +- nbd: always initialize struct msghdr completely +- !5255 CVE-2024-26627 +- scsi: core: Move scsi_host_busy() out of host lock if it is for per-command +- scsi: core: Move scsi_host_busy() out of host lock for waking up EH handler +- !5221 powerpc/mm: Fix null-pointer dereference in pgtable_cache_add +- powerpc/mm: Fix null-pointer dereference in pgtable_cache_add +- !5045 [OLK-6.6] Add support for Mont-TSSE firmware update and fix 0day bugs +- add firmware update function for Mont-TSSE +- fix 0day bugs for Mont-TSSE in CI test +- !5363 [OLK-6.6] ima: Support modsig verify using trusted keys +- ima: Enable modsig appraisal by default +- ima: Support modsig verify using trusted keys +- !5369 Backport 6.6.9-6.6.22 LTS +- KVM/x86: Export RFDS_NO and RFDS_CLEAR to guests +- x86/rfds: Mitigate Register File Data Sampling (RFDS) +- Documentation/hw-vuln: Add documentation for RFDS +- x86/mmio: Disable KVM mitigation when X86_FEATURE_CLEAR_CPU_BUF is set +- selftests: mptcp: decrease BW in simult flows +- readahead: avoid multiple marked readahead pages +- KVM: s390: vsie: fix race during shadow creation +- KVM: s390: add stat counter for shadow gmap events +- net: pds_core: Fix possible double free in error handling path +- netrom: Fix data-races around sysctl_net_busy_read +- netrom: Fix a data-race around sysctl_netrom_link_fails_count +- netrom: Fix a data-race around sysctl_netrom_routing_control +- netrom: Fix a data-race around sysctl_netrom_transport_no_activity_timeout +- netrom: Fix a data-race around sysctl_netrom_transport_requested_window_size +- netrom: Fix a data-race around sysctl_netrom_transport_busy_delay +- netrom: Fix a data-race around sysctl_netrom_transport_acknowledge_delay +- netrom: Fix a data-race around sysctl_netrom_transport_maximum_tries +- netrom: Fix a data-race around sysctl_netrom_transport_timeout +- netrom: Fix data-races around sysctl_netrom_network_ttl_initialiser +- netrom: Fix a data-race around sysctl_netrom_obsolescence_count_initialiser +- netrom: Fix a data-race around sysctl_netrom_default_path_quality +- erofs: apply proper VMA alignment for memory mapped files on THP +- netfilter: nf_conntrack_h323: Add protection for bmp length out of range +- netfilter: nft_ct: fix l3num expectations with inet pseudo family +- net/rds: fix WARNING in rds_conn_connect_if_down +- net: dsa: microchip: fix register write order in ksz8_ind_write8() +- cpumap: Zero-initialise xdp_rxq_info struct before running XDP program +- selftests/bpf: Fix up xdp bonding test wrt feature flags +- xdp, bonding: Fix feature flags when there are no slave devs anymore +- bpf: check bpf_func_state->callback_depth when pruning states +- net/ipv6: avoid possible UAF in ip6_route_mpath_notify() +- igc: avoid returning frame twice in XDP_REDIRECT +- net: ice: Fix potential NULL pointer dereference in ice_bridge_setlink() +- ice: virtchnl: stop pretending to support RSS over AQ or registers +- net: sparx5: Fix use after free inside sparx5_del_mact_entry +- geneve: make sure to pull inner header in geneve_rx() +- tracing/net_sched: Fix tracepoints that save qdisc_dev() as a string +- net/mlx5e: Switch to using _bh variant of of spinlock API in port timestamping NAPI poll context +- net/mlx5e: Use a memory barrier to enforce PTP WQ xmit submission tracking occurs after populating the metadata_map +- net/mlx5e: Fix MACsec state loss upon state update in offload path +- net/mlx5e: Change the warning when ignore_flow_level is not supported +- net/mlx5: Check capability for fw_reset +- net/mlx5: E-switch, Change flow rule destination checking +- Revert "net/mlx5e: Check the number of elements before walk TC rhashtable" +- Revert "net/mlx5: Block entering switchdev mode with ns inconsistency" +- ice: reorder disabling IRQ and NAPI in ice_qp_dis +- i40e: disable NAPI right after disabling irqs when handling xsk_pool +- ixgbe: {dis, en}able irqs in ixgbe_txrx_ring_{dis, en}able +- net: lan78xx: fix runtime PM count underflow on link stop +- xfrm: Pass UDP encapsulation in TX packet offload +- mm/vmscan: fix a bug calling wakeup_kswapd() with a wrong zone index +- ceph: switch to corrected encoding of max_xattr_size in mdsmap +- dmaengine: fsl-edma: correct max_segment_size setting +- dmaengine: fsl-edma: utilize common dt-binding header file +- dt-bindings: dma: fsl-edma: Add fsl-edma.h to prevent hardcoding in dts +- drm/nouveau: don't fini scheduler before entity flush +- selftests: mptcp: rm subflow with v4/v4mapped addr +- selftests: mptcp: add mptcp_lib_is_v6 +- selftests: mptcp: update userspace pm test helpers +- selftests: mptcp: add chk_subflows_total helper +- selftests: mptcp: add evts_get_info helper +- KVM/VMX: Move VERW closer to VMentry for MDS mitigation +- KVM/VMX: Use BT+JNC, i.e. EFLAGS.CF to select VMRESUME vs. VMLAUNCH +- x86/bugs: Use ALTERNATIVE() instead of mds_user_clear static key +- x86/entry_32: Add VERW just before userspace transition +- x86/entry_64: Add VERW just before userspace transition +- block: define bvec_iter as __packed __aligned(4) +- gpio: fix resource unwinding order in error path +- gpiolib: Fix the error path order in gpiochip_add_data_with_key() +- gpio: 74x164: Enable output pins after registers are reset +- powerpc/rtas: use correct function name for resetting TCE tables +- powerpc/pseries/iommu: IOMMU table is not initialized for kdump over SR-IOV +- dmaengine: idxd: Ensure safe user copy of completion record +- dmaengine: idxd: Remove shadow Event Log head stored in idxd +- phy: freescale: phy-fsl-imx8-mipi-dphy: Fix alias name to use dashes +- dmaengine: dw-edma: eDMA: Add sync read before starting the DMA transfer in remote setup +- dmaengine: dw-edma: HDMA: Add sync read before starting the DMA transfer in remote setup +- dmaengine: dw-edma: Add HDMA remote interrupt configuration +- dmaengine: dw-edma: HDMA_V0_REMOTEL_STOP_INT_EN typo fix +- dmaengine: dw-edma: Fix wrong interrupt bit set for HDMA +- dmaengine: dw-edma: Fix the ch_count hdma callback +- ASoC: cs35l56: fix reversed if statement in cs35l56_dspwait_asp1tx_put() +- af_unix: Drop oob_skb ref before purging queue in GC. +- af_unix: Fix task hung while purging oob_skb in GC. +- NFS: Fix data corruption caused by congestion. +- mptcp: fix possible deadlock in subflow diag +- mptcp: fix double-free on socket dismantle +- mptcp: fix potential wake-up event loss +- mptcp: fix snd_wnd initialization for passive socket +- selftests: mptcp: join: add ss mptcp support check +- mptcp: push at DSS boundaries +- mptcp: avoid printing warning once on client side +- mptcp: map v4 address to v6 when destroying subflow +- x86/cpu/intel: Detect TME keyid bits before setting MTRR mask registers +- x86/e820: Don't reserve SETUP_RNG_SEED in e820 +- mm/debug_vm_pgtable: fix BUG_ON with pud advanced test +- pmdomain: qcom: rpmhpd: Fix enabled_corner aggregation +- efivarfs: Request at most 512 bytes for variable names +- kbuild: Add -Wa,--fatal-warnings to as-instr invocation +- riscv: add CALLER_ADDRx support +- RISC-V: Drop invalid test from CONFIG_AS_HAS_OPTION_ARCH +- mmc: sdhci-xenon: fix PHY init clock stability +- mmc: sdhci-xenon: add timeout for PHY init complete +- mmc: core: Fix eMMC initialization with 1-bit bus connection +- mmc: mmci: stm32: fix DMA API overlapping mappings warning +- dmaengine: fsl-qdma: init irq after reg initialization +- dmaengine: fsl-edma: correct calculation of 'nbytes' in multi-fifo scenario +- dmaengine: ptdma: use consistent DMA masks +- crypto: arm64/neonbs - fix out-of-bounds access on short input +- dmaengine: fsl-qdma: fix SoC may hang on 16 byte unaligned read +- soc: qcom: pmic_glink: Fix boot when QRTR=m +- drm/amd/display: Add monitor patch for specific eDP +- drm/buddy: fix range bias +- Revert "drm/amd/pm: resolve reboot exception for si oland" +- btrfs: send: don't issue unnecessary zero writes for trailing hole +- btrfs: dev-replace: properly validate device names +- btrfs: fix double free of anonymous device after snapshot creation failure +- wifi: nl80211: reject iftype change with mesh ID change +- mtd: rawnand: marvell: fix layouts +- gtp: fix use-after-free and null-ptr-deref in gtp_newlink() +- landlock: Fix asymmetric private inodes referring +- Bluetooth: hci_bcm4377: do not mark valid bd_addr as invalid +- ALSA: hda/realtek: Add special fixup for Lenovo 14IRP8 +- ALSA: hda/realtek: fix mute/micmute LED For HP mt440 +- ALSA: hda/realtek: Enable Mute LED on HP 840 G8 (MB 8AB8) +- ALSA: hda/realtek: tas2781: enable subwoofer volume control +- ALSA: ump: Fix the discard error code from snd_ump_legacy_open() +- ALSA: firewire-lib: fix to check cycle continuity +- tomoyo: fix UAF write bug in tomoyo_write_control() +- of: property: fw_devlink: Fix stupid bug in remote-endpoint parsing +- btrfs: fix race between ordered extent completion and fiemap +- riscv: Sparse-Memory/vmemmap out-of-bounds fix +- riscv: Fix pte_leaf_size() for NAPOT +- Revert "riscv: mm: support Svnapot in huge vmap" +- drivers: perf: ctr_get_width function for legacy is not defined +- drivers: perf: added capabilities for legacy PMU +- afs: Fix endless loop in directory parsing +- fbcon: always restore the old font data in fbcon_do_set_font() +- drm/tegra: Remove existing framebuffer only if we support display +- RISC-V: Ignore V from the riscv,isa DT property on older T-Head CPUs +- ASoC: soc-card: Fix missing locking in snd_soc_card_get_kcontrol() +- ASoC: cs35l56: Fix deadlock in ASP1 mixer register initialization +- ASoC: cs35l56: Fix misuse of wm_adsp 'part' string for silicon revision +- ASoC: cs35l56: Fix for initializing ASP1 mixer registers +- ASoC: cs35l56: Don't add the same register patch multiple times +- ASoC: cs35l56: cs35l56_component_remove() must clean up wm_adsp +- ASoC: cs35l56: cs35l56_component_remove() must clear cs35l56->component +- riscv: Fix build error if !CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION +- ASoC: qcom: Fix uninitialized pointer dmactl +- ASoC: qcom: convert not to use asoc_xxx() +- ASoC: soc.h: convert asoc_xxx() to snd_soc_xxx() +- ALSA: Drop leftover snd-rtctimer stuff from Makefile +- ASoC: cs35l56: Must clear HALO_STATE before issuing SYSTEM_RESET +- power: supply: bq27xxx-i2c: Do not free non existing IRQ +- efi/capsule-loader: fix incorrect allocation size +- tls: fix use-after-free on failed backlog decryption +- tls: separate no-async decryption request handling from async +- tls: fix peeking with sync+async decryption +- tls: decrement decrypt_pending if no async completion will be called +- net: hsr: Use correct offset for HSR TLV values in supervisory HSR frames +- igb: extend PTP timestamp adjustments to i211 +- rtnetlink: fix error logic of IFLA_BRIDGE_FLAGS writing back +- tools: ynl: fix handling of multiple mcast groups +- netfilter: nf_tables: allow NFPROTO_INET in nft_(match/target)_validate() +- Bluetooth: qca: Fix triggering coredump implementation +- Bluetooth: hci_qca: Set BDA quirk bit if fwnode exists in DT +- Bluetooth: qca: Fix wrong event type for patch config command +- Bluetooth: Enforce validation on max value of connection interval +- Bluetooth: hci_event: Fix handling of HCI_EV_IO_CAPA_REQUEST +- Bluetooth: hci_event: Fix wrongly recorded wakeup BD_ADDR +- Bluetooth: hci_sync: Fix accept_list when attempting to suspend +- Bluetooth: Avoid potential use-after-free in hci_error_reset +- Bluetooth: hci_sync: Check the correct flag before starting a scan +- stmmac: Clear variable when destroying workqueue +- uapi: in6: replace temporary label with rfc9486 +- net: lan78xx: fix "softirq work is pending" error +- net: usb: dm9601: fix wrong return value in dm9601_mdio_read +- veth: try harder when allocating queue memory +- lan78xx: enable auto speed configuration for LAN7850 if no EEPROM is detected +- ipv6: fix potential "struct net" leak in inet6_rtm_getaddr() +- net: veth: clear GRO when clearing XDP even when down +- cpufreq: intel_pstate: fix pstate limits enforcement for adjust_perf call back +- tun: Fix xdp_rxq_info's queue_index when detaching +- net: dpaa: fman_memac: accept phy-interface-type = "10gbase-r" in the device tree +- net: mctp: take ownership of skb in mctp_local_output +- net: ip_tunnel: prevent perpetual headroom growth +- netlink: add nla be16/32 types to minlen array +- netlink: Fix kernel-infoleak-after-free in __skb_datagram_iter +- spi: cadence-qspi: fix pointer reference in runtime PM hooks +- mtd: spinand: gigadevice: Fix the get ecc status issue +- ublk: move ublk_cancel_dev() out of ub->mutex +- ksmbd: fix wrong allocation size update in smb2_open() +- ASoC: cs35l34: Fix GPIO name and drop legacy include +- fs/ntfs3: fix build without CONFIG_NTFS3_LZX_XPRESS +- ahci: Extend ASM1061 43-bit DMA address quirk to other ASM106x parts +- ata: ahci: add identifiers for ASM2116 series adapters +- mptcp: add needs_id for netlink appending addr +- mptcp: userspace pm send RM_ADDR for ID 0 +- selftests: mptcp: add mptcp_lib_get_counter +- selftests: mptcp: join: stop transfer when check is done (part 2) +- mm: zswap: fix missing folio cleanup in writeback race path +- mm/zswap: invalidate duplicate entry when !zswap_enabled +- selftests: mptcp: join: stop transfer when check is done (part 1) +- i2c: imx: when being a target, mark the last read as processed +- drm/amd/display: Fix memory leak in dm_sw_fini() +- drm/syncobj: handle NULL fence in syncobj_eventfd_entry_func +- drm/syncobj: call drm_syncobj_fence_add_wait when WAIT_AVAILABLE flag is set +- net: phy: realtek: Fix rtl8211f_config_init() for RTL8211F(D)(I)-VD-CG PHY +- Fix write to cloned skb in ipv6_hop_ioam() +- phonet/pep: fix racy skb_queue_empty() use +- phonet: take correct lock to peek at the RX queue +- net: sparx5: Add spinlock for frame transmission from CPU +- net/sched: flower: Add lock protection when remove filter handle +- devlink: fix port dump cmd type +- tools: ynl: don't leak mcast_groups on init error +- tools: ynl: make sure we always pass yarg to mnl_cb_run +- net: mctp: put sock on tag allocation failure +- netfilter: nf_tables: use kzalloc for hook allocation +- netfilter: nf_tables: register hooks last when adding new chain/flowtable +- netfilter: nft_flow_offload: release dst in case direct xmit path is used +- netfilter: nft_flow_offload: reset dst in route object after setting up flow +- netfilter: nf_tables: set dormant flag on hook register failure +- tls: don't skip over different type records from the rx_list +- tls: stop recv() if initial process_rx_list gave us non-DATA +- tls: break out of main loop when PEEK gets a non-data record +- hwmon: (nct6775) Fix access to temperature configuration registers +- cache: ax45mp_cache: Align end size to cache boundary in ax45mp_dma_cache_wback() +- bpf, sockmap: Fix NULL pointer dereference in sk_psock_verdict_data_ready() +- s390: use the correct count for __iowrite64_copy() +- net: ipa: don't overrun IPA suspend interrupt registers +- octeontx2-af: Consider the action set by PF +- drm/i915/tv: Fix TV mode +- platform/x86: thinkpad_acpi: Only update profile if successfully converted +- arm64/sme: Restore SMCR_EL1.EZT0 on exit from suspend +- arm64/sme: Restore SME registers on exit from suspend +- arp: Prevent overflow in arp_req_get(). +- devlink: fix possible use-after-free and memory leaks in devlink_init() +- ipv6: sr: fix possible use-after-free and null-ptr-deref +- afs: Increase buffer size in afs_update_volume_status() +- parisc: Fix stack unwinder +- bpf: Fix racing between bpf_timer_cancel_and_free and bpf_timer_cancel +- ata: ahci_ceva: fix error handling for Xilinx GT PHY support +- selftests: bonding: set active slave to primary eth1 specifically +- powerpc/pseries/iommu: DLPAR add doesn't completely initialize pci_controller +- net: bcmasp: Sanity check is off by one +- net: bcmasp: Indicate MAC is in charge of PHY PM +- ipv6: properly combine dev_base_seq and ipv6.dev_addr_genid +- ipv4: properly combine dev_base_seq and ipv4.dev_addr_genid +- net: stmmac: Fix incorrect dereference in interrupt handlers +- x86/numa: Fix the sort compare func used in numa_fill_memblks() +- x86/numa: Fix the address overlap check in numa_fill_memblks() +- nouveau: fix function cast warnings +- net/sched: act_mirred: don't override retval if we already lost the skb +- net/sched: act_mirred: use the backlog for mirred ingress +- net/sched: act_mirred: Create function tcf_mirred_to_dev and improve readability +- dccp/tcp: Unhash sk from ehash for tb2 alloc failure after check_estalblished(). +- net: bridge: switchdev: Ensure deferred event delivery on unoffload +- net: bridge: switchdev: Skip MDB replays of deferred events on offload +- scsi: jazz_esp: Only build if SCSI core is builtin +- scsi: smartpqi: Fix disable_managed_interrupts +- bpf, scripts: Correct GPL license name +- RDMA/srpt: fix function pointer cast warnings +- xsk: Add truesize to skb_add_rx_frag(). +- arm64: dts: rockchip: Correct Indiedroid Nova GPIO Names +- arm64: dts: rockchip: set num-cs property for spi on px30 +- RDMA/qedr: Fix qedr_create_user_qp error flow +- bus: imx-weim: fix valid range check +- arm64: dts: tqma8mpql: fix audio codec iov-supply +- RDMA/srpt: Support specifying the srpt_service_guid parameter +- RDMA/irdma: Add AE for too many RNRS +- RDMA/irdma: Set the CQ read threshold for GEN 1 +- RDMA/irdma: Validate max_send_wr and max_recv_wr +- RDMA/irdma: Fix KASAN issue with tasklet +- arm64: dts: imx8mp: Disable UART4 by default on Data Modul i.MX8M Plus eDM SBC +- IB/mlx5: Don't expose debugfs entries for RRoCE general parameters if not supported +- RDMA/bnxt_re: Add a missing check in bnxt_qplib_query_srq +- RDMA/bnxt_re: Return error for SRQ resize +- IB/hfi1: Fix a memleak in init_credit_return +- bpf: Derive source IP addr via bpf_*_fib_lookup() +- xen/events: fix error code in xen_bind_pirq_msi_to_irq() +- Revert "drm/amd/display: increased min_dcfclk_mhz and min_fclk_mhz" +- drm/amd/display: Fix buffer overflow in 'get_host_router_total_dp_tunnel_bw()' +- drm/amd/display: Avoid enum conversion warning +- smb3: add missing null server pointer check +- selftests: mptcp: diag: unique 'cestab' subtest names +- selftests: mptcp: diag: unique 'in use' subtest names +- selftests: mptcp: diag: fix bash warnings on older kernels +- selftests: mptcp: diag: check CURRESTAB counters +- selftests: mptcp: pm nl: avoid error msg on older kernels +- selftests: mptcp: pm nl: also list skipped tests +- selftests: mptcp: simult flows: fix some subtest names +- selftests: mptcp: userspace_pm: unique subtest names +- mptcp: fix duplicate subflow creation +- mptcp: fix data races on remote_id +- mptcp: fix data races on local_id +- mptcp: fix lockless access in subflow ULP diag +- mptcp: add needs_id for userspace appending addr +- usb: roles: don't get/set_role() when usb_role_switch is unregistered +- usb: roles: fix NULL pointer issue when put module's reference +- usb: gadget: omap_udc: fix USB gadget regression on Palm TE +- usb: gadget: ncm: Avoid dropping datagrams of properly parsed NTBs +- usb: cdns3: fix memory double free when handle zero packet +- usb: cdns3: fixed memory use after free at cdns3_gadget_ep_disable() +- usb: cdnsp: fixed issue with incorrect detecting CDNSP family controllers +- usb: cdnsp: blocked some cdns3 specific code +- usb: dwc3: gadget: Don't disconnect if not started +- serial: amba-pl011: Fix DMA transmission in RS485 mode +- serial: stm32: do not always set SER_RS485_RX_DURING_TX if RS485 is enabled +- Revert "usb: typec: tcpm: reset counter when enter into unattached state after try role" +- erofs: fix refcount on the metabuf used for inode lookup +- dm-integrity, dm-verity: reduce stack usage for recheck +- ARM: ep93xx: Add terminator to gpiod_lookup_table +- l2tp: pass correct message length to ip6_append_data +- PCI/MSI: Prevent MSI hardware interrupt number truncation +- irqchip/sifive-plic: Enable interrupt if needed before EOI +- irqchip/gic-v3-its: Do not assume vPE tables are preallocated +- irqchip/mbigen: Don't use bus_get_dev_root() to find the parent +- crypto: virtio/akcipher - Fix stack overflow on memcpy +- gtp: fix use-after-free and null-ptr-deref in gtp_genl_dump_pdp() +- accel/ivpu: Don't enable any tiles by default on VPU40xx +- KVM: arm64: vgic-its: Test for valid IRQ in its_sync_lpi_pending_table() +- KVM: arm64: vgic-its: Test for valid IRQ in MOVALL handler +- md: Fix missing release of 'active_io' for flush +- sparc: Fix undefined reference to fb_is_primary_device +- platform/x86: touchscreen_dmi: Allow partial (prefix) matches for ACPI names +- platform/x86: intel-vbtn: Stop calling "VBDL" from notify_handler +- mm/damon/reclaim: fix quota stauts loss due to online tunings +- mm: memcontrol: clarify swapaccount=0 deprecation warning +- mm/damon/lru_sort: fix quota status loss due to online tunings +- mm/swap: fix race when skipping swapcache +- selftests/mm: uffd-unit-test check if huge page size is 0 +- scsi: core: Consult supported VPD page list prior to fetching page +- scsi: target: pscsi: Fix bio_put() for error case +- scsi: sd: usb_storage: uas: Access media prior to querying device properties +- cxl/acpi: Fix load failures due to single window creation failure +- dm-verity: recheck the hash after a failure +- dm-crypt: don't modify the data when using authenticated encryption +- dm-integrity: recheck the integrity tag after a failure +- Revert "parisc: Only list existing CPUs in cpu_possible_mask" +- dm-crypt: recheck the integrity tag after a failure +- lib/Kconfig.debug: TEST_IOV_ITER depends on MMU +- fs/aio: Restrict kiocb_set_cancel_fn() to I/O submitted via libaio +- ata: libata-core: Do not try to set sleeping devices to standby +- s390/cio: fix invalid -EBUSY on ccw_device_start +- drm/amd/display: adjust few initialization order in dm +- drm/meson: Don't remove bridges which are created by other drivers +- drm/ttm: Fix an invalid freeing on already freed page in error path +- btrfs: defrag: avoid unnecessary defrag caused by incorrect extent size +- LoongArch: Update cpu_sibling_map when disabling nonboot CPUs +- LoongArch: Disable IRQ before init_fn() for nonboot CPUs +- LoongArch: Call early_init_fdt_scan_reserved_mem() earlier +- docs: Instruct LaTeX to cope with deeper nesting +- x86/bugs: Add asm helpers for executing VERW +- IB/hfi1: Fix sdma.h tx->num_descs off-by-one error +- xen/events: close evtchn after mapping cleanup +- xen/events: modify internal [un]bind interfaces +- xen/events: drop xen_allocate_irqs_dynamic() +- xen/events: remove some simple helpers from events_base.c +- xen/events: reduce externally visible helper functions +- xen: evtchn: Allow shared registration of IRQ handers +- drm/amd/display: fixed integer types and null check locations +- drm/amd/display: Request usb4 bw for mst streams +- drm/amd/display: Add dpia display mode validation logic +- mptcp: corner case locking for rx path fields initialization +- mptcp: fix more tx path fields initialization +- mptcp: use mptcp_set_state +- mptcp: add CurrEstab MIB counter support +- smb3: clarify mount warning +- cifs: handle cases where multiple sessions share connection +- cifs: change tcon status when need_reconnect is set on it +- virtio-blk: Ensure no requests in virtqueues before deleting vqs. +- smb: client: set correct d_type for reparse points under DFS mounts +- drm/amdgpu: Fix HDP flush for VFs on nbio v7.9 +- drm/amdgpu: Fix shared buff copy to user +- drm/amdgpu: reset gpu for s3 suspend abort case +- drm/amdgpu: skip to program GFXDEC registers for suspend abort +- libceph: fail sparse-read if the data length doesn't match +- firewire: core: send bus reset promptly on gap count error +- accel/ivpu/40xx: Stop passing SKU boot parameters to FW +- accel/ivpu: Disable d3hot_delay on all NPU generations +- accel/ivpu: Force snooping for MMU writes +- LoongArch: vDSO: Disable UBSAN instrumentation +- LoongArch: Change acpi_core_pic[NR_CPUS] to acpi_core_pic[MAX_CORE_PIC] +- LoongArch: Select HAVE_ARCH_SECCOMP to use the common SECCOMP menu +- LoongArch: Select ARCH_ENABLE_THP_MIGRATION instead of redefining it +- scsi: ufs: core: Remove the ufshcd_release() in ufshcd_err_handling_prepare() +- scsi: ufs: core: Fix shift issue in ufshcd_clear_cmd() +- scsi: lpfc: Use unsigned type for num_sge +- hwmon: (coretemp) Enlarge per package core count limit +- efi: Don't add memblocks for soft-reserved memory +- efi: runtime: Fix potential overflow of soft-reserved region size +- wifi: iwlwifi: do not announce EPCS support +- wifi: mac80211: accept broadcast probe responses on 6 GHz +- wifi: mac80211: adding missing drv_mgd_complete_tx() call +- wifi: mac80211: set station RX-NSS on reconfig +- fs/ntfs3: Fix oob in ntfs_listxattr +- fs/ntfs3: Update inode->i_size after success write into compressed file +- fs/ntfs3: Fixed overflow check in mi_enum_attr() +- fs/ntfs3: Correct function is_rst_area_valid +- fs/ntfs3: Use i_size_read and i_size_write +- fs/ntfs3: Prevent generic message "attempt to access beyond end of device" +- fs/ntfs3: use non-movable memory for ntfs3 MFT buffer cache +- fs/ntfs3: Use kvfree to free memory allocated by kvmalloc +- fs/ntfs3: Disable ATTR_LIST_ENTRY size check +- fs/ntfs3: Add NULL ptr dereference checking at the end of attr_allocate_frame() +- fs/ntfs3: ntfs3_forced_shutdown use int instead of bool +- fs/ntfs3: Implement super_operations::shutdown +- fs/ntfs3: Drop suid and sgid bits as a part of fpunch +- fs/ntfs3: Add file_modified +- fs/ntfs3: Fix detected field-spanning write (size 8) of single field "le->name" +- fs/ntfs3: Fix multithreaded stress test +- fs/ntfs3: Reduce stack usage +- fs/ntfs3: Print warning while fixing hard links count +- fs/ntfs3: Correct hard links updating when dealing with DOS names +- fs/ntfs3: Improve ntfs_dir_count +- fs/ntfs3: Modified fix directory element type detection +- fs/ntfs3: Improve alternative boot processing +- Input: i8042 - add Fujitsu Lifebook U728 to i8042 quirk table +- ext4: correct the hole length returned by ext4_map_blocks() +- smb: client: increase number of PDUs allowed in a compound request +- cifs: do not search for channel if server is terminating +- nvmet-fc: take ref count on tgtport before delete assoc +- nvmet-fc: avoid deadlock on delete association path +- nvmet-fc: abort command when there is no binding +- nvmet-fc: hold reference on hostport match +- nvmet-fc: defer cleanup using RCU properly +- nvmet-fc: release reference on target port +- nvmet-fcloop: swap the list_add_tail arguments +- nvme-fc: do not wait in vain when unloading module +- ALSA: usb-audio: Ignore clock selector errors for single connection +- ASoC: wm_adsp: Don't overwrite fwf_name with the default +- cifs: make sure that channel scaling is done only once +- drm/amd/display: increased min_dcfclk_mhz and min_fclk_mhz +- drm/amdkfd: Use correct drm device for cgroup permission check +- netfilter: conntrack: check SCTP_CID_SHUTDOWN_ACK for vtag setting in sctp_new +- misc: open-dice: Fix spurious lockdep warning +- Input: xpad - add Lenovo Legion Go controllers +- spi: sh-msiof: avoid integer overflow in constants +- regulator (max5970): Fix IRQ handler +- ASoC: sunxi: sun4i-spdif: Add support for Allwinner H616 +- ALSA: usb-audio: Check presence of valid altsetting control +- usb: ucsi_acpi: Quirk to ack a connector change ack cmd +- nvmet-tcp: fix nvme tcp ida memory leak +- HID: nvidia-shield: Add missing null pointer checks to LED initialization +- ALSA: hda: Increase default bdl_pos_adj for Apollo Lake +- ALSA: hda: Replace numeric device IDs with constant values +- HID: logitech-hidpp: add support for Logitech G Pro X Superlight 2 +- regulator: pwm-regulator: Add validity checks in continuous .get_voltage +- ASoC: amd: acp: Add check for cpu dai link initialization +- dmaengine: ti: edma: Add some null pointer checks to the edma_probe +- Input: goodix - accept ACPI resources with gpio_count == 3 && gpio_int_idx == 0 +- ext4: avoid allocating blocks from corrupted group in ext4_mb_find_by_goal() +- ext4: avoid allocating blocks from corrupted group in ext4_mb_try_best_found() +- ext4: avoid dividing by 0 in mb_update_avg_fragment_size() when block bitmap corrupt +- platform/x86: touchscreen_dmi: Add info for the TECLAST X16 Plus tablet +- MIPS: reserve exception vector space ONLY ONCE +- ARM: dts: Fix TPM schema violations +- ahci: add 43-bit DMA address quirk for ASMedia ASM1061 controllers +- spi: cs42l43: Handle error from devm_pm_runtime_enable +- aoe: avoid potential deadlock at set_capacity +- ahci: asm1166: correct count of reported ports +- cifs: helper function to check replayable error codes +- cifs: translate network errors on send to -ECONNABORTED +- cifs: cifs_pick_channel should try selecting active channels +- smb: Work around Clang __bdos() type confusion +- block: Fix WARNING in _copy_from_iter +- spi: intel-pci: Add support for Arrow Lake SPI serial flash +- platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full +- fbdev: sis: Error out if pixclock equals zero +- fbdev: savage: Error out if pixclock equals zero +- wifi: mac80211: fix race condition on enabling fast-xmit +- wifi: cfg80211: fix missing interfaces when dumping +- dmaengine: dw-edma: increase size of 'name' in debugfs code +- dmaengine: fsl-qdma: increase size of 'irq_name' +- dmaengine: shdma: increase size of 'dev_id' +- cifs: open_cached_dir should not rely on primary channel +- scsi: target: core: Add TMF to tmr_list handling +- tools: selftests: riscv: Fix compile warnings in mm tests +- tools: selftests: riscv: Fix compile warnings in vector tests +- scsi: smartpqi: Fix logical volume rescan race condition +- scsi: smartpqi: Add new controller PCI IDs +- dmaengine: apple-admac: Keep upper bits of REG_BUS_WIDTH +- riscv/efistub: Ensure GP-relative addressing is not used +- PCI: dwc: Fix a 64bit bug in dw_pcie_ep_raise_msix_irq() +- sched/rt: Disallow writing invalid values to sched_rt_period_us +- tracing: Fix a NULL vs IS_ERR() bug in event_subsystem_dir() +- tracing: Make system_callback() function static +- Documentation/arch/ia64/features.rst: fix kernel-feat directive +- nilfs2: fix potential bug in end_buffer_async_write +- of: property: Add in-ports/out-ports support to of_graph_get_port_parent() +- sched/membarrier: reduce the ability to hammer on sys_membarrier +- x86/efistub: Use 1:1 file:memory mapping for PE/COFF .compat section +- x86/boot: Increase section and file alignment to 4k/512 +- x86/boot: Split off PE/COFF .data section +- x86/boot: Drop PE/COFF .reloc section +- x86/boot: Construct PE/COFF .text section from assembler +- x86/boot: Derive file size from _edata symbol +- x86/boot: Define setup size in linker script +- x86/boot: Set EFI handover offset directly in header asm +- x86/boot: Grab kernel_info offset from zoffset header directly +- x86/boot: Drop references to startup_64 +- x86/boot: Drop redundant code setting the root device +- x86/boot: Omit compression buffer from PE/COFF image memory footprint +- x86/boot: Remove the 'bugger off' message +- x86/efi: Drop alignment flags from PE section headers +- x86/efi: Disregard setup header of loaded image +- x86/efi: Drop EFI stub .bss from .data section +- nfsd: don't take fi_lock in nfsd_break_deleg_cb() +- eventfs: Keep all directory links at 1 +- eventfs: Remove fsnotify*() functions from lookup() +- eventfs: Restructure eventfs_inode structure to be more condensed +- eventfs: Warn if an eventfs_inode is freed without is_freed being set +- eventfs: Get rid of dentry pointers without refcounts +- eventfs: Clean up dentry ops and add revalidate function +- eventfs: Remove unused d_parent pointer field +- tracefs: dentry lookup crapectomy +- tracefs: Avoid using the ei->dentry pointer unnecessarily +- eventfs: Initialize the tracefs inode properly +- tracefs: Zero out the tracefs_inode when allocating it +- tracefs: remove stale update_gid code +- eventfs: Save directory inodes in the eventfs_inode structure +- eventfs: Use kcalloc() instead of kzalloc() +- eventfs: Do not create dentries nor inodes in iterate_shared +- eventfs: Have the inodes all for files and directories all be the same +- eventfs: Shortcut eventfs_iterate() by skipping entries already read +- eventfs: Read ei->entries before ei->children in eventfs_iterate() +- eventfs: Do ctx->pos update for all iterations in eventfs_iterate() +- eventfs: Have eventfs_iterate() stop immediately if ei->is_freed is set +- tracefs/eventfs: Use root and instance inodes as default ownership +- eventfs: Stop using dcache_readdir() for getdents() +- eventfs: Remove "lookup" parameter from create_dir/file_dentry() +- eventfs: Fix bitwise fields for "is_events" +- tracefs: Check for dentry->d_inode exists in set_gid() +- eventfs: Fix file and directory uid and gid ownership +- eventfs: Have event files and directories default to parent uid and gid +- eventfs: Fix events beyond NAME_MAX blocking tasks +- eventfs: Make sure that parent->d_inode is locked in creating files/dirs +- eventfs: Do not allow NULL parent to eventfs_start_creating() +- eventfs: Move taking of inode_lock into dcache_dir_open_wrapper() +- eventfs: Use GFP_NOFS for allocation when eventfs_mutex is held +- eventfs: Do not invalidate dentry in create_file/dir_dentry() +- eventfs: Remove expectation that ei->is_freed means ei->dentry == NULL +- eventfs: Use simple_recursive_removal() to clean up dentries +- eventfs: Remove special processing of dput() of events directory +- eventfs: Delete eventfs_inode when the last dentry is freed +- eventfs: Hold eventfs_mutex when calling callback functions +- eventfs: Save ownership and mode +- eventfs: Test for ei->is_freed when accessing ei->dentry +- eventfs: Have a free_ei() that just frees the eventfs_inode +- eventfs: Remove "is_freed" union with rcu head +- eventfs: Fix kerneldoc of eventfs_remove_rec() +- eventfs: Remove extra dget() in eventfs_create_events_dir() +- eventfs: Fix typo in eventfs_inode union comment +- eventfs: Fix WARN_ON() in create_file_dentry() +- tracefs/eventfs: Modify mismatched function name +- eventfs: Fix failure path in eventfs_create_events_dir() +- eventfs: Use ERR_CAST() in eventfs_create_events_dir() +- eventfs: Use eventfs_remove_events_dir() +- eventfs: Remove eventfs_file and just use eventfs_inode +- Revert "eventfs: Remove "is_freed" union with rcu head" +- Revert "eventfs: Save ownership and mode" +- Revert "eventfs: Delete eventfs_inode when the last dentry is freed" +- Revert "eventfs: Use simple_recursive_removal() to clean up dentries" +- Revert "eventfs: Check for NULL ef in eventfs_set_attr()" +- Revert "eventfs: Do not allow NULL parent to eventfs_start_creating()" +- parisc: Fix random data corruption from exception handler +- netfilter: ipset: Missing gc cancellations fixed +- netfilter: ipset: fix performance regression in swap operation +- block: fix partial zone append completion handling in req_bio_endio() +- tracing: Inform kmemleak of saved_cmdlines allocation +- tracing: Fix HAVE_DYNAMIC_FTRACE_WITH_REGS ifdef +- fs/proc: do_task_stat: move thread_group_cputime_adjusted() outside of lock_task_sighand() +- pmdomain: core: Move the unused cleanup to a _sync initcall +- can: j1939: Fix UAF in j1939_sk_match_filter during setsockopt(SO_J1939_FILTER) +- can: j1939: prevent deadlock by changing j1939_socks_lock to rwlock +- can: netlink: Fix TDCO calculation using the old data bittiming +- of: property: fix typo in io-channels +- docs: kernel_feat.py: fix build error for missing files +- blk-wbt: Fix detection of dirty-throttled tasks +- LoongArch: Fix earlycon parameter if KASAN enabled +- mm: hugetlb pages should not be reserved by shmat() if SHM_NORESERVE +- ceph: prevent use-after-free in encode_cap_msg() +- hv_netvsc: Register VF in netvsc_probe if NET_DEVICE_REGISTER missed +- net: stmmac: protect updates of 64-bit statistics counters +- pmdomain: renesas: r8a77980-sysc: CR7 must be always on +- net: ethernet: ti: cpsw_new: enable mac_managed_pm to fix mdio +- s390/qeth: Fix potential loss of L3-IP@ in case of network issues +- net: ethernet: ti: cpsw: enable mac_managed_pm to fix mdio +- fs: relax mount_setattr() permission checks +- tools/rtla: Fix Makefile compiler options for clang +- tools/rtla: Fix uninitialized bucket/data->bucket_size warning +- tools/rtla: Exit with EXIT_SUCCESS when help is invoked +- tools/rtla: Fix clang warning about mount_point var size +- tools/rtla: Replace setting prio with nice for SCHED_OTHER +- tools/rtla: Remove unused sched_getattr() function +- tools/rv: Fix Makefile compiler options for clang +- tools/rv: Fix curr_reactor uninitialized variable +- ASoC: amd: yc: Add DMI quirk for Lenovo Ideapad Pro 5 16ARP8 +- ASoC: tas2781: add module parameter to tascodec_init() +- ASoC: SOF: IPC3: fix message bounds on ipc ops +- arm64: Subscribe Microsoft Azure Cobalt 100 to ARM Neoverse N2 errata +- arm64/signal: Don't assume that TIF_SVE means we saved SVE state +- mmc: sdhci-pci-o2micro: Fix a warm reboot issue that disk can't be detected by BIOS +- zonefs: Improve error handling +- KVM: arm64: Fix circular locking dependency +- smb: Fix regression in writes when non-standard maximum write size negotiated +- smb: client: set correct id, uid and cruid for multiuser automounts +- thunderbolt: Fix setting the CNS bit in ROUTER_CS_5 +- irqchip/gic-v3-its: Fix GICv4.1 VPE affinity update +- irqchip/gic-v3-its: Restore quirk probing for ACPI-based systems +- irqchip/irq-brcmstb-l2: Add write memory barrier before exit +- wifi: iwlwifi: mvm: fix a crash when we run out of stations +- wifi: mac80211: reload info pointer in ieee80211_tx_dequeue() +- wifi: cfg80211: fix wiphy delayed work queueing +- wifi: iwlwifi: fix double-free bug +- nfp: flower: prevent re-adding mac index for bonded port +- nfp: enable NETDEV_XDP_ACT_REDIRECT feature flag +- nfp: use correct macro for LengthSelect in BAR config +- crypto: algif_hash - Remove bogus SGL free on zero-length error path +- crypto: ccp - Fix null pointer dereference in __sev_platform_shutdown_locked +- nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() +- nilfs2: fix data corruption in dsync block recovery for small block sizes +- ALSA: hda/realtek: add IDs for Dell dual spk platform +- ALSA: hda/conexant: Add quirk for SWS JS201D +- ALSA: hda/realtek: fix mute/micmute LED For HP mt645 +- mmc: slot-gpio: Allow non-sleeping GPIO ro +- io_uring/net: fix multishot accept overflow handling +- x86/mm/ident_map: Use gbpages only where full GB page should be mapped. +- KVM: x86/pmu: Fix type length error when reading pmu->fixed_ctr_ctrl +- KVM: x86: make KVM_REQ_NMI request iff NMI pending for vcpu +- x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 +- serial: mxs-auart: fix tx +- serial: core: introduce uart_port_tx_flags() +- powerpc/pseries: fix accuracy of stolen time +- powerpc/cputable: Add missing PPC_FEATURE_BOOKE on PPC64 Book-E +- powerpc/64: Set task pt_regs->link to the LR value on scv entry +- ftrace: Fix DIRECT_CALLS to use SAVE_REGS by default +- serial: max310x: prevent infinite while() loop in port startup +- serial: max310x: fail probe if clock crystal is unstable +- serial: max310x: improve crystal stable clock detection +- serial: max310x: set default value when reading clock ready bit +- nfp: flower: fix hardware offload for the transfer layer port +- nfp: flower: add hardware offload check for post ct entry +- net: dsa: mv88e6xxx: Fix failed probe due to unsupported C45 reads +- ring-buffer: Clean ring_buffer_poll_wait() error return +- hv_netvsc: Fix race condition between netvsc_probe and netvsc_remove +- drm/amd/display: Preserve original aspect ratio in create stream +- drm/amd/display: Increase frame-larger-than for all display_mode_vba files +- drm/amd/display: Fix MST Null Ptr for RV +- drm/amdgpu/soc21: update VCN 4 max HEVC encoding resolution +- drm/prime: Support page array >= 4GB +- drm/amd/display: Add align done check +- drm/msm: Wire up tlb ops +- ksmbd: free aux buffer if ksmbd_iov_pin_rsp_read fails +- media: rc: bpf attach/detach requires write permission +- pmdomain: mediatek: fix race conditions with genpd +- iio: pressure: bmp280: Add missing bmp085 to SPI id table +- iio: imu: bno055: serdev requires REGMAP +- iio: imu: adis: ensure proper DMA alignment +- iio: adc: ad_sigma_delta: ensure proper DMA alignment +- iio: accel: bma400: Fix a compilation problem +- iio: commom: st_sensors: ensure proper DMA alignment +- iio: core: fix memleak in iio_device_register_sysfs +- iio: magnetometer: rm3100: add boundary check for the value read from RM3100_REG_TMRC +- staging: iio: ad5933: fix type mismatch regression +- tracing/probes: Fix to search structure fields correctly +- tracing/probes: Fix to set arg size and fmt after setting type from BTF +- tracing/probes: Fix to show a parse error for bad type for $comm +- tracing/synthetic: Fix trace_string() return value +- tracing: Fix wasted memory in saved_cmdlines logic +- tracing/timerlat: Move hrtimer_init to timerlat_fd open() +- ext4: avoid bb_free and bb_fragments inconsistency in mb_free_blocks() +- ext4: fix double-free of blocks due to wrong extents moved_len +- misc: fastrpc: Mark all sessions as invalid in cb_remove +- binder: signal epoll threads of self-work +- ALSA: hda/realtek: fix mute/micmute LEDs for HP ZBook Power +- ALSA: hda/cs8409: Suppress vmaster control for Dolphin models +- ASoC: codecs: wcd938x: handle deferred probe +- ALSA: hda/realtek - Add speaker pin verbtable for Dell dual speaker platform +- ALSA: hda/realtek: Enable headset mic on Vaio VJFE-ADL +- usb: typec: tpcm: Fix issues with power being removed during reset +- modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS +- linux/init: remove __memexit* annotations +- um: Fix adding '-no-pie' for clang +- xen-netback: properly sync TX responses +- parisc: BTLB: Fix crash when setting up BTLB at CPU bringup +- net: stmmac: do not clear TBS enable bit on link up/down +- net: hsr: remove WARN_ONCE() in send_hsr_supervision_frame() +- nfc: nci: free rx_data_reassembly skb on NCI device cleanup +- kbuild: Fix changing ELF file type for output of gen_btf for big endian +- ALSA: hda/realtek: Apply headset jack quirk for non-bass alc287 thinkpads +- firewire: core: correct documentation of fw_csr_string() kernel API +- lsm: fix the logic in security_inode_getsecctx() +- lsm: fix default return value of the socket_getpeersec_*() hooks +- drm/amd: Don't init MEC2 firmware when it fails to load +- drm/amdgpu: Reset IH OVERFLOW_CLEAR bit +- drm/virtio: Set segment size for virtio_gpu device +- connector/cn_proc: revert "connector: Fix proc_event_num_listeners count not cleared" +- Revert "drm/msm/gpu: Push gpu lock down past runpm" +- Revert "drm/amd: flush any delayed gfxoff on suspend entry" +- scsi: Revert "scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock" +- media: Revert "media: rkisp1: Drop IRQF_SHARED" +- Revert "powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add" +- mptcp: really cope with fastopen race +- mptcp: check addrs list in userspace_pm_get_local_id +- mptcp: fix rcv space initialization +- mptcp: drop the push_pending field +- selftests: mptcp: add mptcp_lib_kill_wait +- selftests: mptcp: allow changing subtests prefix +- selftests: mptcp: increase timeout to 30 min +- selftests: mptcp: add missing kconfig for NF Mangle +- selftests: mptcp: add missing kconfig for NF Filter in v6 +- selftests: mptcp: add missing kconfig for NF Filter +- mptcp: fix data re-injection from stale subflow +- kallsyms: ignore ARMv4 thunks along with others +- modpost: trim leading spaces when processing source files list +- i2c: i801: Fix block process call transactions +- i2c: pasemi: split driver into two separate modules +- powerpc/kasan: Limit KASAN thread size increase to 32KB +- irqchip/gic-v3-its: Handle non-coherent GICv4 redistributors +- i2c: qcom-geni: Correct I2C TRE sequence +- cifs: fix underflow in parse_server_interfaces() +- iio: adc: ad4130: only set GPIO_CTRL if pin is unused +- iio: adc: ad4130: zero-initialize clock init data +- PCI: Fix active state requirement in PME polling +- Revert "kobject: Remove redundant checks for whether ktype is NULL" +- powerpc/kasan: Fix addr error caused by page alignment +- powerpc/6xx: set High BAT Enable flag on G2_LE cores +- powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add +- driver core: fw_devlink: Improve detection of overlapping cycles +- media: ir_toy: fix a memleak in irtoy_tx +- interconnect: qcom: sm8550: Enable sync_state +- interconnect: qcom: sc8180x: Mark CO0 BCM keepalive +- usb: dwc3: gadget: Fix NULL pointer dereference in dwc3_gadget_suspend +- usb: core: Prevent null pointer dereference in update_port_device_state +- usb: chipidea: core: handle power lost in workqueue +- usb: f_mass_storage: forbid async queue when shutdown happen +- USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT +- usb: ucsi_acpi: Fix command completion handling +- usb: ulpi: Fix debugfs directory leak +- usb: ucsi: Add missing ppm_lock +- iio: hid-sensor-als: Return 0 for HID_USAGE_SENSOR_TIME_TIMESTAMP +- HID: wacom: Do not register input devices until after hid_hw_start +- HID: wacom: generic: Avoid reporting a serial of '0' to userspace +- HID: i2c-hid-of: fix NULL-deref on failed power up +- HID: bpf: actually free hdev memory after attaching a HID-BPF program +- HID: bpf: remove double fdget() +- ALSA: hda/realtek: Enable Mute LED on HP Laptop 14-fq0xxx +- ALSA: hda/realtek: Fix the external mic not being recognised for Acer Swift 1 SF114-32 +- parisc: Prevent hung tasks when printing inventory on serial console +- ASoC: amd: yc: Add DMI quirk for MSI Bravo 15 C7VF +- dm-crypt, dm-verity: disable tasklets +- nouveau: offload fence uevents work to workqueue +- scsi: storvsc: Fix ring buffer size calculation +- selftests: mm: fix map_hugetlb failure on 64K page size systems +- selftests/mm: Update va_high_addr_switch.sh to check CPU for la57 flag +- mm/writeback: fix possible divide-by-zero in wb_dirty_limits(), again +- selftests/mm: switch to bash from sh +- tracing/trigger: Fix to return error if failed to alloc snapshot +- scs: add CONFIG_MMU dependency for vfree_atomic() +- selftests/mm: ksm_tests should only MADV_HUGEPAGE valid memory +- userfaultfd: fix mmap_changing checking in mfill_atomic_hugetlb +- i40e: Fix waiting for queues of all VSIs to be disabled +- i40e: Do not allow untrusted VF to remove administratively set MAC +- mm/memory: Use exception ip to search exception tables +- ptrace: Introduce exception_ip arch hook +- MIPS: Add 'memory' clobber to csum_ipv6_magic() inline assembler +- nouveau/svm: fix kvcalloc() argument order +- net: sysfs: Fix /sys/class/net/ path for statistics +- ASoC: rt5645: Fix deadlock in rt5645_jack_detect_work() +- spi: ppc4xx: Drop write-only variable +- net: tls: fix returned read length with async decrypt +- net: tls: fix use-after-free with partial reads and async decrypt +- net: tls: handle backlogging of crypto requests +- tls: fix race between tx work scheduling and socket close +- tls: fix race between async notify and socket close +- net: tls: factor out tls_*crypt_async_wait() +- tls: extract context alloc/initialization out of tls_set_sw_offload +- lan966x: Fix crash when adding interface under a lag +- net: openvswitch: limit the number of recursions from action sets +- selftests: forwarding: Fix bridge locked port test flakiness +- selftests: forwarding: Suppress grep warnings +- selftests: bridge_mdb: Use MDB get instead of dump +- selftests: forwarding: Fix bridge MDB test flakiness +- selftests: forwarding: Fix layer 2 miss test flakiness +- selftests: net: Fix bridge backup port test flakiness +- selftests/net: convert test_bridge_backup_port.sh to run it in unique namespace +- perf: CXL: fix mismatched cpmu event opcode +- ALSA: hda/cs35l56: select intended config FW_CS_DSP +- of: property: Improve finding the supplier of a remote-endpoint property +- of: property: Improve finding the consumer of a remote-endpoint property +- devlink: Fix command annotation documentation +- bonding: do not report NETDEV_XDP_ACT_XSK_ZEROCOPY +- net/handshake: Fix handshake_req_destroy_test1 +- ASoC: SOF: ipc3-topology: Fix pipeline tear down logic +- wifi: iwlwifi: uninitialized variable in iwl_acpi_get_ppag_table() +- wifi: iwlwifi: Fix some error codes +- KVM: selftests: Fix a semaphore imbalance in the dirty ring logging test +- spi: imx: fix the burst length at DMA mode and CPU mode +- drm/msm/gem: Fix double resv lock aquire +- of: unittest: Fix compile in the non-dynamic case +- KVM: selftests: Avoid infinite loop in hyperv_features when invtsc is missing +- KVM: selftests: Delete superfluous, unused "stage" variable in AMX test +- selftests/landlock: Fix fs_test build with old libc +- driver core: Fix device_link_flag_is_sync_state_only() +- btrfs: don't drop extent_map for free space inode on write error +- btrfs: reject encoded write if inode has nodatasum flag set +- btrfs: don't reserve space for checksums when writing to nocow files +- btrfs: send: return EOPNOTSUPP on unknown flags +- btrfs: forbid deleting live subvol qgroup +- btrfs: do not ASSERT() if the newly created subvolume already got read +- btrfs: forbid creating subvol qgroups +- btrfs: do not delete unused block group if it may be used soon +- btrfs: add and use helper to check if block group is used +- update workarounds for gcc "asm goto" issue +- work around gcc bugs with 'asm goto' with outputs +- netfilter: nft_set_rbtree: skip end interval element from gc +- net: stmmac: xgmac: fix a typo of register name in DPP safety handling +- ALSA: usb-audio: Sort quirk table entries +- net: stmmac: xgmac: use #define for string constants +- io_uring/net: limit inline multishot retries +- io_uring/poll: add requeue return code from poll multishot handling +- io_uring/net: un-indent mshot retry path in io_recv_finish() +- io_uring/poll: move poll execution helpers higher up +- io_uring/net: fix sr->len for IORING_OP_RECV with MSG_WAITALL and buffers +- media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) +- Revert "ASoC: amd: Add new dmi entries for acp5x platform" +- Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID +- Input: i8042 - fix strange behavior of touchpad on Clevo NS70PU +- hrtimer: Report offline hrtimer enqueue +- usb: dwc3: pci: add support for the Intel Arrow Lake-H +- xhci: handle isoc Babble and Buffer Overrun events properly +- xhci: process isoc TD properly when there was a transaction error mid TD. +- usb: host: xhci-plat: Add support for XHCI_SG_TRB_CACHE_SIZE_QUIRK +- usb: dwc3: host: Set XHCI_SG_TRB_CACHE_SIZE_QUIRK +- x86/lib: Revert to _ASM_EXTABLE_UA() for {get,put}_user() fixups +- Revert "usb: typec: tcpm: fix cc role at port reset" +- USB: serial: cp210x: add ID for IMST iM871A-USB +- USB: serial: option: add Fibocom FM101-GL variant +- USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e +- ALSA: usb-audio: add quirk for RODE NT-USB+ +- ALSA: usb-audio: Add a quirk for Yamaha YIT-W12TX transmitter +- ALSA: usb-audio: Add delay quirk for MOTU M Series 2nd revision +- blk-iocost: Fix an UBSAN shift-out-of-bounds warning +- riscv: declare overflow_stack as exported from traps.c +- riscv: Fix arch_hugetlb_migration_supported() for NAPOT +- libceph: just wait for more data to be available on the socket +- libceph: rename read_sparse_msg_*() to read_partial_sparse_msg_*() +- riscv: Flush the tlb when a page directory is freed +- scsi: core: Move scsi_host_busy() out of host lock if it is for per-command +- riscv: Fix hugetlb_mask_last_page() when NAPOT is enabled +- riscv: Fix set_huge_pte_at() for NAPOT mapping +- riscv: mm: execute local TLB flush after populating vmemmap +- mm: Introduce flush_cache_vmap_early() +- riscv: Improve flush_tlb_kernel_range() +- riscv: Make __flush_tlb_range() loop over pte instead of flushing the whole tlb +- riscv: Improve tlb_flush() +- fs/ntfs3: Fix an NULL dereference bug +- netfilter: nft_set_pipapo: remove scratch_aligned pointer +- netfilter: nft_set_pipapo: add helper to release pcpu scratch area +- netfilter: nft_set_pipapo: store index in scratch maps +- netfilter: nft_ct: reject direction for ct id +- drm/amd/display: Implement bounds check for stream encoder creation in DCN301 +- drm/amd/display: Add NULL test for 'timing generator' in 'dcn21_set_pipe()' +- drm/amd/display: Fix 'panel_cntl' could be null in 'dcn21_set_backlight_level()' +- netfilter: nft_compat: restrict match/target protocol to u16 +- netfilter: nft_compat: reject unused compat flag +- netfilter: nft_compat: narrow down revision to unsigned 8-bits +- selftests: cmsg_ipv6: repeat the exact packet +- ppp_async: limit MRU to 64K +- af_unix: Call kfree_skb() for dead unix_(sk)->oob_skb in GC. +- tipc: Check the bearer type before calling tipc_udp_nl_bearer_add() +- selftests: net: let big_tcp test cope with slow env +- rxrpc: Fix counting of new acks and nacks +- rxrpc: Fix response to PING RESPONSE ACKs to a dead call +- rxrpc: Fix delayed ACKs to not set the reference serial number +- rxrpc: Fix generation of serial numbers to skip zero +- drm/i915/gvt: Fix uninitialized variable in handle_mmio() +- inet: read sk->sk_family once in inet_recv_error() +- hwmon: (coretemp) Fix bogus core_id to attr name mapping +- hwmon: (coretemp) Fix out-of-bounds memory access +- hwmon: (aspeed-pwm-tacho) mutex for tach reading +- octeontx2-pf: Fix a memleak otx2_sq_init +- atm: idt77252: fix a memleak in open_card_ubr0 +- tunnels: fix out of bounds access when building IPv6 PMTU error +- tsnep: Fix mapping for zero copy XDP_TX action +- selftests: net: avoid just another constant wait +- selftests: net: fix tcp listener handling in pmtu.sh +- selftests/net: change shebang to bash to support "source" +- selftests/net: convert pmtu.sh to run it in unique namespace +- selftests/net: convert unicast_extensions.sh to run it in unique namespace +- selftests: net: cut more slack for gro fwd tests. +- net: atlantic: Fix DMA mapping for PTP hwts ring +- netdevsim: avoid potential loop in nsim_dev_trap_report_work() +- wifi: brcmfmac: Adjust n_channels usage for __counted_by +- wifi: iwlwifi: exit eSR only after the FW does +- wifi: mac80211: fix waiting for beacons logic +- wifi: mac80211: fix RCU use in TDLS fast-xmit +- net: stmmac: xgmac: fix handling of DPP safety error for DMA channels +- x86/efistub: Avoid placing the kernel below LOAD_PHYSICAL_ADDR +- x86/efistub: Give up if memory attribute protocol returns an error +- drm/msm/dpu: check for valid hw_pp in dpu_encoder_helper_phys_cleanup +- drm/msm/dp: return correct Colorimetry for DP_TEST_DYNAMIC_RANGE_CEA case +- drm/msms/dp: fixed link clock divider bits be over written in BPC unknown case +- xfs: respect the stable writes flag on the RT device +- xfs: clean up FS_XFLAG_REALTIME handling in xfs_ioctl_setattr_xflags +- xfs: dquot recovery does not validate the recovered dquot +- xfs: clean up dqblk extraction +- xfs: inode recovery does not validate the recovered inode +- xfs: fix again select in kconfig XFS_ONLINE_SCRUB_STATS +- xfs: fix internal error from AGFL exhaustion +- xfs: up(ic_sema) if flushing data device fails +- xfs: only remap the written blocks in xfs_reflink_end_cow_extent +- xfs: allow read IO and FICLONE to run concurrently +- xfs: handle nimaps=0 from xfs_bmapi_write in xfs_alloc_file_space +- xfs: introduce protection for drop nlink +- xfs: make sure maxlen is still congruent with prod when rounding down +- xfs: fix units conversion error in xfs_bmap_del_extent_delay +- xfs: rt stubs should return negative errnos when rt disabled +- xfs: prevent rt growfs when quota is enabled +- xfs: hoist freeing of rt data fork extent mappings +- xfs: bump max fsgeom struct version +- MAINTAINERS: add Catherine as xfs maintainer for 6.6.y +- rust: upgrade to Rust 1.73.0 +- rust: print: use explicit link in documentation +- rust: task: remove redundant explicit link +- rust: upgrade to Rust 1.72.1 +- rust: arc: add explicit `drop()` around `Box::from_raw()` +- cifs: failure to add channel on iface should bump up weight +- cifs: avoid redundant calls to disable multichannel +- phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP +- dmaengine: fix is_slave_direction() return false when DMA_DEV_TO_DEV +- perf evlist: Fix evlist__new_default() for > 1 core PMU +- phy: renesas: rcar-gen3-usb2: Fix returning wrong error code +- dmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA +- dmaengine: fsl-qdma: Fix a memory leak related to the status queue DMA +- dmaengine: ti: k3-udma: Report short packet errors +- dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools +- pds_core: Prevent health thread from running during reset/remove +- drm/amdgpu: Fix missing error code in 'gmc_v6/7/8/9_0_hw_init()' +- ASoC: codecs: wsa883x: fix PA volume control +- ASoC: codecs: lpass-wsa-macro: fix compander volume hack +- ASoC: codecs: wcd938x: fix headphones volume controls +- ASoC: qcom: sc8280xp: limit speaker volumes +- bonding: remove print in bond_verify_device_path +- selftests/bpf: Remove flaky test_btf_id test +- LoongArch/smp: Call rcutree_report_cpu_starting() at tlb_init() +- drm/msm/dsi: Enable runtime PM +- Revert "drm/amd/display: Disable PSR-SU on Parade 0803 TCON again" +- mm, kmsan: fix infinite recursion due to RCU critical section +- arm64: irq: set the correct node for shadow call stack +- selftests: net: enable some more knobs +- selftests: net: add missing config for NF_TARGET_TTL +- selftests: bonding: Check initial state +- selftests: team: Add missing config options +- net: sysfs: Fix /sys/class/net/ path +- octeontx2-pf: Remove xdp queues on program detach +- selftests: net: don't access /dev/stdout in pmtu.sh +- selftests: net: fix available tunnels detection +- selftests: net: add missing config for pmtu.sh tests +- selftests: net: add missing config for nftables-backed iptables +- pds_core: Rework teardown/setup flow to be more common +- pds_core: Clear BARs on reset +- pds_core: Prevent race issues involving the adminq +- pds_core: implement pci reset handlers +- pds_core: Use struct pdsc for the pdsc_adminq_isr private data +- pds_core: Cancel AQ work on teardown +- af_unix: fix lockdep positive in sk_diag_dump_icons() +- net: ipv4: fix a memleak in ip_setup_cork +- netfilter: nft_ct: sanitize layer 3 and 4 protocol number in custom expectations +- netfilter: nf_log: replace BUG_ON by WARN_ON_ONCE when putting logger +- netfilter: nf_tables: restrict tunnel object to NFPROTO_NETDEV +- netfilter: conntrack: correct window scaling with retransmitted SYN +- selftests: net: add missing config for GENEVE +- devlink: Fix referring to hw_addr attribute during state validation +- bridge: mcast: fix disabled snooping after long uptime +- selftests: net: Add missing matchall classifier +- llc: call sock_orphan() at release time +- ipv6: Ensure natural alignment of const ipv6 loopback and router addresses +- net: dsa: qca8k: fix illegal usage of GPIO +- ixgbe: Fix an error handling path in ixgbe_read_iosf_sb_reg_x550() +- ixgbe: Refactor overtemp event handling +- ixgbe: Refactor returning internal error codes +- e1000e: correct maximum frequency adjustment values +- tcp: add sanity checks to rx zerocopy +- net: lan966x: Fix port configuration when using SGMII interface +- ipmr: fix kernel panic when forwarding mcast packets +- net: dsa: mt7530: fix 10M/100M speed on MT7988 switch +- ip6_tunnel: make sure to pull inner header in __ip6_tnl_rcv() +- selftests: net: give more time for GRO aggregation +- selftests: net: add missing required classifier +- selftests: net: add missing config for big tcp tests +- net: phy: mediatek-ge-soc: sync driver with MediaTek SDK +- net: ethernet: mtk_eth_soc: set DMA coherent mask to get PPE working +- gve: Fix skb truesize underestimation +- selftests: net: explicitly wait for listener ready +- selftests: net: remove dependency on ebpf tests +- HID: hidraw: fix a problem of memory leak in hidraw_release() +- scsi: core: Move scsi_host_busy() out of host lock for waking up EH handler +- regulator: ti-abb: don't use devm_platform_ioremap_resource_byname for shared interrupt register +- kunit: run test suites only after module initialization completes +- scsi: isci: Fix an error code problem in isci_io_request_build() +- riscv: Fix build error on rv32 + XIP +- drm/amdkfd: only flush mes process context if mes support is there +- drm: using mul_u32_u32() requires linux/math64.h +- wifi: cfg80211: fix RCU dereference in __cfg80211_bss_update +- perf: Fix the nr_addr_filters fix +- i2c: rk3x: Adjust mask/value offset for i2c2 on rv1126 +- drm/amdkfd: Fix 'node' NULL check in 'svm_range_get_range_boundaries()' +- drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()' +- drm/amdgpu: Fix with right return code '-EIO' in 'amdgpu_gmc_vram_checking()' +- drm/amd/powerplay: Fix kzalloc parameter 'ATOM_Tonga_PPM_Table' in 'get_platform_power_management_table()' +- drm/amdgpu: fix avg vs input power reporting on smu7 +- ceph: fix invalid pointer access if get_quota_realm return ERR_PTR +- ceph: reinitialize mds feature bit even when session in open +- virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings +- drm/amdkfd: Fix lock dependency warning with srcu +- drm/amdkfd: Fix lock dependency warning +- libsubcmd: Fix memory leak in uniq() +- misc: lis3lv02d_i2c: Add missing setting of the reg_ctrl callback +- usb: xhci-plat: fix usb disconnect issue after s4 +- 9p: Fix initialisation of netfs_inode for 9p +- PCI/AER: Decode Requester ID when no error info found +- PCI: Fix 64GT/s effective data rate calculation +- spmi: mediatek: Fix UAF on device remove +- fs/kernfs/dir: obey S_ISGID +- tty: allow TIOCSLCKTRMIOS with CAP_CHECKPOINT_RESTORE +- selftests/sgx: Fix linker script asserts +- usb: hub: Add quirk to decrease IN-ep poll interval for Microchip USB491x hub +- usb: hub: Replace hardcoded quirk value with BIT() macro +- extcon: fix possible name leak in extcon_dev_register() +- perf cs-etm: Bump minimum OpenCSD version to ensure a bugfix is present +- PCI: switchtec: Fix stdev_release() crash after surprise hot remove +- PCI: Only override AMD USB controller if required +- mailbox: arm_mhuv2: Fix a bug for mhuv2_sender_interrupt +- mfd: ti_am335x_tscadc: Fix TI SoC dependencies +- xen/gntdev: Fix the abuse of underlying struct page in DMA-buf import +- riscv: Make XIP bootable again +- i3c: master: cdns: Update maximum prescaler value for i2c clock +- um: time-travel: fix time corruption +- um: net: Fix return type of uml_net_start_xmit() +- um: Don't use vfprintf() for os_info() +- um: Fix naming clash between UML and scheduler +- leds: trigger: panic: Don't register panic notifier if creating the trigger failed +- pinctrl: baytrail: Fix types of config value in byt_pin_config_set() +- ALSA: hda/conexant: Fix headset auto detect fail in cx8070 and SN6140 +- drm/amdgpu: apply the RV2 system aperture fix to RN/CZN as well +- drm/amdkfd: Fix iterator used outside loop in 'kfd_add_peer_prop()' +- drm/amdgpu: Drop 'fence' check in 'to_amdgpu_amdkfd_fence()' +- drm/amdgpu: Fix '*fw' from request_firmware() not released in 'amdgpu_ucode_request()' +- Re-revert "drm/amd/display: Enable Replay for static screen use cases" +- drm/amdgpu: Let KFD sync with VM fences +- drm/amd/display: Fix minor issues in BW Allocation Phase2 +- drm/amdgpu: Fix ecc irq enable/disable unpaired +- clk: imx: clk-imx8qxp: fix LVDS bypass, pixel and phy clocks +- drm/amd/display: Only clear symclk otg flag for HDMI +- drm/amd/display: make flip_timestamp_in_us a 64-bit variable +- accel/habanalabs: add support for Gaudi2C device +- watchdog: it87_wdt: Keep WDTCTRL bit 3 unmodified for IT8784/IT8786 +- watchdog: starfive: add lock annotations to fix context imbalances +- clk: mmp: pxa168: Fix memory leak in pxa168_clk_init() +- clk: hi3620: Fix memory leak in hi3620_mmc_clk_init() +- drm/amdgpu: fix ftrace event amdgpu_bo_move always move on same heap +- drm/msm/dpu: fix writeback programming for YUV cases +- drm/msm/dpu: Ratelimit framedone timeout msgs +- drm/msm/dpu: enable writeback on SM8450 +- drm/msm/dpu: enable writeback on SM8350 +- drm/amdkfd: fix mes set shader debugger process management +- drm/amd/display: Force p-state disallow if leaving no plane config +- drm/amd/display: For prefetch mode > 0, extend prefetch if possible +- media: i2c: imx335: Fix hblank min/max values +- media: ddbridge: fix an error code problem in ddb_probe +- media: amphion: remove mutext lock in condition of wait_event +- IB/ipoib: Fix mcast list locking +- drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time +- hwmon: (hp-wmi-sensors) Fix failure to load on EliteDesk 800 G6 +- hwmon: (nct6775) Fix fan speed set failure in automatic mode +- media: rkisp1: resizer: Stop manual allocation of v4l2_subdev_state +- media: rkisp1: Fix IRQ disable race issue +- media: rkisp1: Store IRQ lines +- media: rkisp1: Fix IRQ handler return values +- media: rkisp1: Drop IRQF_SHARED +- media: uvcvideo: Fix power line control for SunplusIT camera +- media: uvcvideo: Fix power line control for a Chicony camera +- drm/msm/dp: Add DisplayPort controller for SM8650 +- ALSA: hda: intel-dspcfg: add filters for ARL-S and ARL +- ALSA: hda: Intel: add HDA_ARL PCI ID support +- PCI: add INTEL_HDA_ARL to pci_ids.h +- media: rockchip: rga: fix swizzling for RGB formats +- media: stk1160: Fixed high volume of stk1160_dbg messages +- drm/mipi-dsi: Fix detach call without attach +- drm/framebuffer: Fix use of uninitialized variable +- drm/drm_file: fix use of uninitialized variable +- drm/amd/display: Fix MST PBN/X.Y value calculations +- ASoC: amd: Add new dmi entries for acp5x platform +- f2fs: fix write pointers on zoned device after roll forward +- drm/amd/display: Fix tiled display misalignment +- drm/bridge: anx7625: Fix Set HPD irq detect window to 2ms +- drm/panel-edp: Add override_edid_mode quirk for generic edp +- RDMA/IPoIB: Fix error code return in ipoib_mcast_join +- reiserfs: Avoid touching renamed directory if parent does not change +- fast_dput(): handle underflows gracefully +- ASoC: doc: Fix undefined SND_SOC_DAPM_NOPM argument +- ALSA: hda: Refer to correct stream index at loops +- f2fs: fix to check return value of f2fs_reserve_new_block() +- net: dsa: qca8k: put MDIO bus OF node on qca8k_mdio_register() failure +- net: kcm: fix direct access to bv_len +- octeontx2-af: Fix max NPC MCAM entry check while validating ref_entry +- i40e: Fix VF disable behavior to block all traffic +- arm64: dts: sprd: Change UMS512 idle-state nodename to match bindings +- arm64: dts: sprd: Add clock reference for pll2 on UMS512 +- bridge: cfm: fix enum typo in br_cc_ccm_tx_parse +- net/smc: disable SEID on non-s390 archs where virtual ISM may be used +- Bluetooth: L2CAP: Fix possible multiple reject send +- Bluetooth: hci_sync: fix BR/EDR wakeup bug +- Bluetooth: ISO: Avoid creating child socket if PA sync is terminating +- Bluetooth: qca: Set both WIDEBAND_SPEECH and LE_STATES quirks for QCA2066 +- wifi: cfg80211: free beacon_ies when overridden from hidden BSS +- wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift() +- libbpf: Fix NULL pointer dereference in bpf_object__collect_prog_relos +- wifi: rtw89: coex: Fix wrong Wi-Fi role info and FDDT parameter members +- wifi: rtl8xxxu: Add additional USB IDs for RTL8192EU devices +- arm64: dts: amlogic: fix format for s4 uart node +- ice: fix pre-shifted bit usage +- arm64: dts: qcom: Fix coresight warnings in in-ports and out-ports +- arm64: dts: qcom: msm8998: Fix 'out-ports' is a required property +- arm64: dts: qcom: msm8996: Fix 'in-ports' is a required property +- block: prevent an integer overflow in bvec_try_merge_hw_page +- net: dsa: mv88e6xxx: Fix mv88e6352_serdes_get_stats error path +- net: atlantic: eliminate double free in error handling logic +- ice: fix ICE_AQ_VSI_Q_OPT_RSS_* register values +- scsi: hisi_sas: Set .phy_attached before notifing phyup event HISI_PHYE_PHY_UP_PM +- scsi: lpfc: Move determination of vmid_flag after VMID reinitialization completes +- scsi: lpfc: Reinitialize an NPIV's VMID data structures after FDISC +- ARM: dts: imx23/28: Fix the DMA controller node name +- ARM: dts: imx23-sansa: Use preferred i2c-gpios properties +- ARM: dts: imx27-apf27dev: Fix LED name +- ARM: dts: imx25/27: Pass timing0 +- ARM: dts: imx25: Fix the iim compatible string +- selftests/bpf: fix compiler warnings in RELEASE=1 mode +- arm64: zynqmp: Fix clock node name in kv260 cards +- arm64: zynqmp: Move fixed clock to / for kv260 +- block/rnbd-srv: Check for unlikely string overflow +- ionic: bypass firmware cmds when stuck in reset +- ionic: pass opcode to devcmd_wait +- net: phy: at803x: fix passing the wrong reference for config_intr +- ARM: dts: imx1: Fix sram node +- ARM: dts: imx27: Fix sram node +- ARM: dts: imx: Use flash@0,0 pattern +- ARM: dts: imx25/27-eukrea: Fix RTC node name +- ARM: dts: rockchip: fix rk3036 hdmi ports node +- wifi: ath12k: fix the issue that the multicast/broadcast indicator is not read correctly for WCN7850 +- bpf: Set uattr->batch.count as zero before batched update or deletion +- wifi: mt76: mt7996: add PCI IDs for mt7992 +- wifi: mt76: connac: fix EHT phy mode check +- arm64: dts: qcom: sm8350: Fix remoteproc interrupt type +- arm64: dts: qcom: sm8450: fix soundwire controllers node name +- arm64: dts: qcom: sm8550: fix soundwire controllers node name +- net: mvmdio: Avoid excessive sleeps in polled mode +- minmax: relax check to allow comparison between unsigned arguments and signed constants +- minmax: allow comparisons of 'int' against 'unsigned char/short' +- minmax: fix indentation of __cmp_once() and __clamp_once() +- minmax: allow min()/max()/clamp() if the arguments have the same signedness. +- minmax: add umin(a, b) and umax(a, b) +- minmax: fix header inclusions +- minmax: deduplicate __unconst_integer_typeof() +- scsi: libfc: Fix up timeout error in fc_fcp_rec_error() +- scsi: libfc: Don't schedule abort twice +- wifi: ath12k: fix and enable AP mode for WCN7850 +- bpf: Set need_defer as false when clearing fd array during map free +- bpf: Check rcu_read_lock_trace_held() before calling bpf map helpers +- wifi: rtw89: fix misbehavior of TX beacon in concurrent mode +- wifi: ath11k: fix race due to setting ATH11K_FLAG_EXT_IRQ_ENABLED too early +- wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus() +- bpf: Fix a few selftest failures due to llvm18 change +- ARM: dts: imx7s: Fix nand-controller #size-cells +- ARM: dts: imx7s: Fix lcdif compatible +- ARM: dts: imx7d: Fix coresight funnel ports +- scsi: arcmsr: Support new PCI device IDs 1883 and 1886 +- scsi: mpi3mr: Add PCI checks where SAS5116 diverges from SAS4116 +- scsi: mpi3mr: Add support for SAS5116 PCI IDs +- net: usb: ax88179_178a: avoid two consecutive device resets +- bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk +- PCI: Add no PM reset quirk for NVIDIA Spectrum devices +- net: phy: micrel: fix ts_info value in case of no phc +- ARM: dts: samsung: s5pv210: fix camera unit addresses/ranges +- ARM: dts: samsung: exynos4: fix camera unit addresses/ranges +- scsi: lpfc: Fix possible file string name overflow when updating firmware +- soc: xilinx: fix unhandled SGI warning message +- soc: xilinx: Fix for call trace due to the usage of smp_processor_id() +- ARM: dts: qcom: msm8660: fix PMIC node labels +- ARM: dts: qcom: mdm9615: fix PMIC node labels +- ARM: dts: qcom: strip prefix from PMIC files +- selftests/bpf: Fix issues in setup_classid_environment() +- wifi: rt2x00: correct wrong BBP register in RxDCOC calibration +- selftests/bpf: Fix pyperf180 compilation failure with clang18 +- libbpf: Fix potential uninitialized tail padding with LIBBPF_OPTS_RESET +- selftests/bpf: satisfy compiler by having explicit return in btf test +- selftests/bpf: fix RELEASE=1 build for tc_opts +- wifi: rt2x00: restart beacon queue when hardware reset +- wifi: rtw89: fix timeout calculation in rtw89_roc_end() +- ext4: avoid online resizing failures due to oversized flex bg +- ext4: remove unnecessary check from alloc_flex_gd() +- ext4: unify the type of flexbg_size to unsigned int +- ext4: fix inconsistent between segment fstrim and full fstrim +- ecryptfs: Reject casefold directory inodes +- smb: client: fix hardlinking of reparse points +- smb: client: fix renaming of reparse points +- ext4: treat end of range as exclusive in ext4_zero_range() +- SUNRPC: Fix a suspicious RCU usage warning +- sysctl: Fix out of bounds access for empty sysctl registers +- KVM: s390: fix setting of fpc register +- s390/ptrace: handle setting of fpc register correctly +- s390/vfio-ap: fix sysfs status attribute for AP queue devices +- arch: consolidate arch_irq_work_raise prototypes +- s390/boot: always align vmalloc area on segment boundary +- jfs: fix array-index-out-of-bounds in diNewExt +- rxrpc_find_service_conn_rcu: fix the usage of read_seqbegin_or_lock() +- afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*() +- afs: fix the usage of read_seqbegin_or_lock() in afs_lookup_volume_rcu() +- crypto: stm32/crc32 - fix parsing list of devices +- erofs: fix ztailpacking for subpage compressed blocks +- crypto: octeontx2 - Fix cptvf driver cleanup +- crypto: starfive - Fix dev_err_probe return error +- erofs: fix up compacted indexes for block size < 4096 +- pstore/ram: Fix crash when setting number of cpus to an odd number +- crypto: p10-aes-gcm - Avoid -Wstringop-overflow warnings +- hwrng: starfive - Fix dev_err_probe return error +- jfs: fix uaf in jfs_evict_inode +- jfs: fix array-index-out-of-bounds in dbAdjTree +- jfs: fix slab-out-of-bounds Read in dtSearch +- UBSAN: array-index-out-of-bounds in dtSplitRoot +- FS:JFS:UBSAN:array-index-out-of-bounds in dbAdjTree +- thermal: core: Fix thermal zone suspend-resume synchronization +- ACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events +- PM / devfreq: Synchronize devfreq_monitor_[start/stop] +- kunit: tool: fix parsing of test attributes +- ACPI: NUMA: Fix the logic of getting the fake_pxm value +- selftests/nolibc: fix testcase status alignment +- ACPI: extlog: fix NULL pointer dereference check +- PNP: ACPI: fix fortify warning +- ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop +- audit: Send netlink ACK before setting connection in auditd_set +- regulator: core: Only increment use_count when enable_count changes +- debugobjects: Stop accessing objects after releasing hash bucket lock +- perf/core: Fix narrow startup race when creating the perf nr_addr_filters sysfs file +- x86/mce: Mark fatal MCE's page as poison to avoid panic in the kdump kernel +- powerpc: pmd_move_must_withdraw() is only needed for CONFIG_TRANSPARENT_HUGEPAGE +- x86/boot: Ignore NMIs during very early boot +- powerpc/64s: Fix CONFIG_NUMA=n build due to create_section_mapping() +- powerpc/mm: Fix build failures due to arch_reserved_kernel_pages() +- powerpc: Fix build error due to is_valid_bugaddr() +- drivers/perf: pmuv3: don't expose SW_INCR event in sysfs +- arm64: irq: set the correct node for VMAP stack +- powerpc/mm: Fix null-pointer dereference in pgtable_cache_add +- asm-generic: make sparse happy with odd-sized put_unaligned_*() +- Documentation/sphinx: fix Python string escapes +- thermal: trip: Drop lockdep assertion from thermal_zone_trip_id() +- serial: core: fix kernel-doc for uart_port_unlock_irqrestore() +- x86/entry/ia32: Ensure s32 is sign extended to s64 +- tick/sched: Preserve number of idle sleeps across CPU hotplug events +- clocksource: Skip watchdog check for large watchdog intervals +- genirq: Initialize resend_node hlist for all interrupt descriptors +- mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan +- cxl/region:Fix overflow issue in alloc_hpa() +- drm: bridge: samsung-dsim: Don't use FORCE_STOP_STATE +- MIPS: lantiq: register smp_ops on non-smp platforms +- spi: fix finalize message on error return +- cifs: fix stray unlock in cifs_chan_skip_or_disable +- spi: spi-cadence: Reverse the order of interleaved write and read operations +- spi: bcm-qspi: fix SFDP BFPT read by usig mspi read +- cpufreq/amd-pstate: Fix setting scaling max/min freq values +- drm/bridge: anx7625: Ensure bridge is suspended in disable() +- block: Move checking GENHD_FL_NO_PART to bdev_add_partition() +- spi: intel-pci: Remove Meteor Lake-S SoC PCI ID from the list +- ARM: dts: exynos4212-tab3: add samsung,invert-vclk flag to fimd +- gpio: eic-sprd: Clear interrupt after set the interrupt type +- firmware: arm_scmi: Use xa_insert() when saving raw queues +- firmware: arm_scmi: Use xa_insert() to store opps +- drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume +- drm/exynos: fix accidental on-stack copy of exynos_drm_plane +- memblock: fix crash when reserved memory is not added to memory +- drm/bridge: parade-ps8640: Make sure we drop the AUX mutex in the error case +- drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable() +- drm/bridge: sii902x: Fix audio codec unregistration +- drm/bridge: sii902x: Fix probing race issue +- drm/panel: samsung-s6d7aa0: drop DRM_BUS_FLAG_DE_HIGH for lsl080al02 +- drm: panel-simple: add missing bus flags for Tianma tm070jvhg[30/33] +- drm/bridge: parade-ps8640: Wait for HPD when doing an AUX transfer +- drm/amdgpu/gfx11: set UNORD_DISPATCH in compute MQDs +- drm/amdgpu/gfx10: set UNORD_DISPATCH in compute MQDs +- drm/panel-edp: drm/panel-edp: Fix AUO B116XTN02 name +- drm/panel-edp: drm/panel-edp: Fix AUO B116XAK01 name and timing +- drm/panel-edp: Add AUO B116XTN02, BOE NT116WHM-N21,836X2, NV116WHM-N49 V8.0 +- drm/i915/psr: Only allow PSR in LPSP mode on HSW non-ULT +- drm/i915/lnl: Remove watchdog timers for PSR +- btrfs: zoned: optimize hint byte for zoned allocator +- btrfs: zoned: factor out prepare_allocation_zoned() +- serial: sc16is7xx: fix unconditional activation of THRI interrupt +- serial: sc16is7xx: Use port lock wrappers +- serial: core: Provide port lock wrappers +- mm: migrate: fix getting incorrect page mapping during page migration +- mm: migrate: record the mlocked page status to remove unnecessary lru drain +- thermal: gov_power_allocator: avoid inability to reset a cdev +- thermal: core: Store trip pointer in struct thermal_instance +- thermal: trip: Drop redundant trips check from for_each_thermal_trip() +- media: i2c: imx290: Properly encode registers as little-endian +- media: v4l2-cci: Add support for little-endian encoded registers +- media: v4l: cci: Add macros to obtain register width and address +- media: v4l: cci: Include linux/bits.h +- pipe: wakeup wr_wait after setting max_usage +- fs/pipe: move check to pipe_has_watch_queue() +- thermal: intel: hfi: Add syscore callbacks for system-wide PM +- thermal: intel: hfi: Disable an HFI instance when all its CPUs go offline +- thermal: intel: hfi: Refactor enabling code into helper functions +- net/bpf: Avoid unused "sin_addr_len" warning when CONFIG_CGROUP_BPF is not set +- drm/amd/display: Fix uninitialized variable usage in core_link_ 'read_dpcd() & write_dpcd()' functions +- drm/amdgpu/pm: Fix the power source flag error +- drm/amd/display: Fix late derefrence 'dsc' check in 'link_set_dsc_pps_packet()' +- drm/amd/display: Align the returned error code with legacy DP +- drm/amd/display: Port DENTIST hang and TDR fixes to OTG disable W/A +- drm/amd/display: Fix variable deferencing before NULL check in edp_setup_replay() +- drm/amdgpu: correct the cu count for gfx v11 +- drm/bridge: nxp-ptn3460: simplify some error checking +- Revert "drm/amd/display: fix bandwidth validation failure on DCN 2.1" +- drm/amd/display: Disable PSR-SU on Parade 0803 TCON again +- drm/amd/display: fix bandwidth validation failure on DCN 2.1 +- drm: Allow drivers to indicate the damage helpers to ignore damage clips +- drm/virtio: Disable damage clipping if FB changed since last page-flip +- drm: Disable the cursor plane on atomic contexts with virtualized drivers +- drm/tidss: Fix atomic_flush check +- drm: Fix TODO list mentioning non-KMS drivers +- drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking +- drm: Don't unref the same fb many times by mistake due to deadlock handling +- Revert "drm/i915/dsi: Do display on sequence later on icl+" +- cpufreq: intel_pstate: Refine computation of P-state for given frequency +- gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04 +- xfs: read only mounts with fsopen mount API are busted +- drm/amdgpu: Fix the null pointer when load rlc firmware +- Revert "drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync" +- firmware: arm_scmi: Check mailbox/SMT channel for consistency +- ksmbd: fix global oob in ksmbd_nl_policy +- platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe +- platform/x86: intel-uncore-freq: Fix types in sysfs callbacks +- netfilter: nf_tables: reject QUEUE/DROP verdict parameters +- netfilter: nft_chain_filter: handle NETDEV_UNREGISTER for inet/ingress basechain +- hv_netvsc: Calculate correct ring size when PAGE_SIZE is not 4 Kbytes +- nfsd: fix RELEASE_LOCKOWNER +- wifi: iwlwifi: fix a memory corruption +- exec: Fix error handling in begin_new_exec() +- rbd: don't move requests to the running list on errors +- btrfs: don't abort filesystem when attempting to snapshot deleted subvolume +- btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args +- btrfs: don't warn if discard range is not aligned to sector +- btrfs: tree-checker: fix inline ref size in error messages +- btrfs: ref-verify: free ref cache before clearing mount opt +- btrfs: avoid copying BTRFS_ROOT_SUBVOL_DEAD flag to snapshot of subvolume being deleted +- btrfs: zoned: fix lock ordering in btrfs_zone_activate() +- tsnep: Fix XDP_RING_NEED_WAKEUP for empty fill ring +- tsnep: Remove FCS for XDP data path +- net: fec: fix the unhandled context fault from smmu +- selftests: bonding: do not test arp/ns target with mode balance-alb/tlb +- fjes: fix memleaks in fjes_hw_setup +- i40e: update xdp_rxq_info::frag_size for ZC enabled Rx queue +- i40e: set xdp_rxq_info::frag_size +- xdp: reflect tail increase for MEM_TYPE_XSK_BUFF_POOL +- ice: update xdp_rxq_info::frag_size for ZC enabled Rx queue +- intel: xsk: initialize skb_frag_t::bv_offset in ZC drivers +- ice: remove redundant xdp_rxq_info registration +- i40e: handle multi-buffer packets that are shrunk by xdp prog +- ice: work on pre-XDP prog frag count +- xsk: fix usage of multi-buffer BPF helpers for ZC XDP +- bpf: Add bpf_sock_addr_set_sun_path() to allow writing unix sockaddr from bpf +- bpf: Propagate modified uaddrlen from cgroup sockaddr programs +- xsk: make xsk_buff_pool responsible for clearing xdp_buff::flags +- xsk: recycle buffer in case Rx queue was full +- selftests: netdevsim: fix the udp_tunnel_nic test +- selftests: net: fix rps_default_mask with >32 CPUs +- net: mvpp2: clear BM pool before initialization +- net: stmmac: Wait a bit for the reset to take effect +- netfilter: nf_tables: validate NFPROTO_* family +- netfilter: nf_tables: restrict anonymous set and map names to 16 bytes +- netfilter: nft_limit: reject configurations that cause integer overflow +- rcu: Defer RCU kthreads wakeup when CPU is dying +- net/mlx5e: fix a potential double-free in fs_any_create_groups +- net/mlx5e: fix a double-free in arfs_create_groups +- net/mlx5e: Ignore IPsec replay window values on sender side +- net/mlx5e: Allow software parsing when IPsec crypto is enabled +- net/mlx5: Use mlx5 device constant for selecting CQ period mode for ASO +- net/mlx5: DR, Can't go to uplink vport on RX rule +- net/mlx5: DR, Use the right GVMI number for drop action +- net/mlx5: Bridge, fix multicast packets sent to uplink +- net/mlx5: Bridge, Enable mcast in smfs steering mode +- net/mlx5: Fix a WARN upon a callback command failure +- net/mlx5e: Fix peer flow lists handling +- net/mlx5e: Fix operation precedence bug in port timestamping napi_poll context +- net/sched: flower: Fix chain template offload +- selftests: fill in some missing configs for net +- ipv6: init the accept_queue's spinlocks in inet6_create +- netlink: fix potential sleeping issue in mqueue_flush_file +- selftest: Don't reuse port for SO_INCOMING_CPU test. +- tcp: Add memory barrier to tcp_push() +- afs: Hide silly-rename files from userspace +- tracing: Ensure visibility when inserting an element into tracing_map +- netfs, fscache: Prevent Oops in fscache_put_cache() +- net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv +- net: micrel: Fix PTP frame parsing for lan8814 +- tun: add missing rx stats accounting in tun_xdp_act +- tun: fix missing dropped counter in tun_xdp_act +- net: fix removing a namespace with conflicting altnames +- udp: fix busy polling +- llc: Drop support for ETH_P_TR_802_2. +- llc: make llc_ui_sendmsg() more robust against bonding changes +- vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING +- bnxt_en: Prevent kernel warning when running offline self test +- bnxt_en: Wait for FLR to complete during probe +- tcp: make sure init the accept_queue's spinlocks once +- selftests: bonding: Increase timeout to 1200s +- net/smc: fix illegal rmb_desc access in SMC-D connection dump +- wifi: mac80211: fix potential sta-link leak +- SUNRPC: use request size to initialize bio_vec in svc_udp_sendto() +- cifs: after disabling multichannel, mark tcon for reconnect +- cifs: fix a pending undercount of srv_count +- cifs: fix lock ordering while disabling multichannel +- Revert "drm/amd: Enable PCIe PME from D3" +- selftests/bpf: check if max number of bpf_loop iterations is tracked +- bpf: keep track of max number of bpf_loop callback iterations +- selftests/bpf: test widening for iterating callbacks +- bpf: widening for callback iterators +- selftests/bpf: tests for iterating callbacks +- bpf: verify callbacks as if they are called unknown number of times +- bpf: extract setup_func_entry() utility function +- bpf: extract __check_reg_arg() utility function +- selftests/bpf: track string payload offset as scalar in strobemeta +- selftests/bpf: track tcp payload offset as scalar in xdp_synproxy +- bpf: print full verifier states on infinite loop detection +- selftests/bpf: test if state loops are detected in a tricky case +- bpf: correct loop detection for iterators convergence +- selftests/bpf: tests with delayed read/precision makrs in loop body +- bpf: exact states comparison for iterator convergence checks +- bpf: extract same_callsites() as utility function +- bpf: move explored_state() closer to the beginning of verifier.c +- dt-bindings: net: snps,dwmac: Tx coe unsupported +- ksmbd: Add missing set_freezable() for freezable kthread +- ksmbd: send lease break notification on FILE_RENAME_INFORMATION +- ksmbd: don't increment epoch if current state and request state are same +- ksmbd: fix potential circular locking issue in smb2_set_ea() +- ksmbd: set v2 lease version on lease upgrade +- serial: Do not hold the port lock when setting rx-during-tx GPIO +- mm: page_alloc: unreserve highatomic page blocks before oom +- LoongArch/smp: Call rcutree_report_cpu_starting() earlier +- serial: sc16is7xx: improve do/while loop in sc16is7xx_irq() +- serial: sc16is7xx: remove obsolete loop in sc16is7xx_port_irq() +- serial: sc16is7xx: fix invalid sc16is7xx_lines bitfield in case of probe error +- serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions for FIFO +- serial: sc16is7xx: change EFR lock to operate on each channels +- serial: sc16is7xx: remove unused line structure member +- serial: sc16is7xx: remove global regmap from struct sc16is7xx_port +- serial: sc16is7xx: remove wasteful static buffer in sc16is7xx_regmap_name() +- serial: sc16is7xx: improve regmap debugfs by using one regmap per port +- rename(): fix the locking of subdirectories +- mm/sparsemem: fix race in accessing memory_section->usage +- mm/rmap: fix misplaced parenthesis of a likely() +- selftests: mm: hugepage-vmemmap fails on 64K page size systems +- kexec: do syscore_shutdown() in kernel_kexec +- ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path +- nouveau/vmm: don't set addr on the fail path to avoid warning +- rtc: Extend timeout for waiting for UIP to clear to 1s +- rtc: Add support for configuring the UIP timeout for RTC reads +- rtc: mc146818-lib: Adjust failure return code for mc146818_get_time() +- rtc: Adjust failure return code for cmos_set_alarm() +- rtc: cmos: Use ACPI alarm for non-Intel x86 systems too +- arm64: entry: fix ARM64_WORKAROUND_SPECULATIVE_UNPRIV_LOAD +- arm64/sme: Always exit sme_alloc() early with existing storage +- arm64: errata: Add Cortex-A510 speculative unprivileged load workaround +- arm64: Rename ARM64_WORKAROUND_2966298 +- riscv: mm: Fixup compat mode boot failure +- riscv: mm: Fixup compat arch_get_mmap_end +- media: mtk-jpeg: Fix use after free bug due to error path handling in mtk_jpeg_dec_device_run +- media: mtk-jpeg: Fix timeout schedule error in mtk_jpegdec_worker. +- media: i2c: st-mipid02: correct format propagation +- mmc: mmc_spi: remove custom DMA mapped buffers +- mmc: core: Use mrq.sbc in close-ended ffu +- media: videobuf2-dma-sg: fix vmap callback +- scripts/get_abi: fix source path leak +- docs: kernel_abi.py: fix command injection +- dlm: use kernel_connect() and kernel_bind() +- lsm: new security_file_ioctl_compat() hook +- ARM: dts: qcom: sdx55: fix USB SS wakeup +- arm64: dts: qcom: sdm670: fix USB SS wakeup +- arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts +- arm64: dts: qcom: sc8180x: fix USB SS wakeup +- arm64: dts: qcom: sc8180x: fix USB DP/DM HS PHY interrupts +- arm64: dts: qcom: sm8150: fix USB SS wakeup +- arm64: dts: qcom: sm8150: fix USB DP/DM HS PHY interrupts +- arm64: dts: qcom: sdm845: fix USB SS wakeup +- arm64: dts: qcom: sdm845: fix USB DP/DM HS PHY interrupts +- ARM: dts: qcom: sdx55: fix USB DP/DM HS PHY interrupts +- arm64: dts: qcom: Add missing vio-supply for AW2013 +- arm64: dts: qcom: sc7280: fix usb_1 wakeup interrupt types +- arm64: dts: qcom: sc8180x: fix USB wakeup interrupt types +- arm64: dts: qcom: sm8150: fix USB wakeup interrupt types +- arm64: dts: qcom: sdm670: fix USB wakeup interrupt types +- arm64: dts: qcom: sdm845: fix USB wakeup interrupt types +- arm64: dts: qcom: sc7180: fix USB wakeup interrupt types +- arm64: dts: qcom: msm8939: Make blsp_dma controlled-remotely +- arm64: dts: qcom: msm8916: Make blsp_dma controlled-remotely +- arm64: dts: rockchip: Fix rk3588 USB power-domain clocks +- arm64: dts: rockchip: configure eth pad driver strength for orangepi r1 plus lts +- arm64: dts: sprd: fix the cpu node for UMS512 +- ARM: dts: qcom: sdx55: fix pdc '#interrupt-cells' +- ARM: dts: samsung: exynos4210-i9100: Unconditionally enable LDO12 +- ARM: dts: qcom: sdx55: fix USB wakeup interrupt types +- arm64: dts: qcom: sc8280xp-crd: fix eDP phy compatible +- ARM: dts: imx6q-apalis: add can power-up delay on ixora board +- parisc/power: Fix power soft-off button emulation on qemu +- parisc/firmware: Fix F-extend for PDC addresses +- bus: mhi: host: Add spinlock to protect WP access when queueing TREs +- bus: mhi: host: Drop chan lock before queuing buffers +- bus: mhi: host: Add alignment check for event ring read pointer +- mips: Fix max_mapnr being uninitialized on early stages +- nbd: always initialize struct msghdr completely +- s390/vfio-ap: do not reset queue removed from host config +- s390/vfio-ap: reset queues associated with adapter for queue unbound from driver +- s390/vfio-ap: reset queues filtered from the guest's AP config +- s390/vfio-ap: let on_scan_complete() callback filter matrix and update guest's APCB +- s390/vfio-ap: loop over the shadow APCB when filtering guest's AP configuration +- soc: fsl: cpm1: qmc: Fix rx channel reset +- soc: fsl: cpm1: qmc: Fix __iomem addresses declaration +- soc: fsl: cpm1: tsa: Fix __iomem addresses declaration +- media: ov01a10: Enable runtime PM before registering async sub-device +- media: ov13b10: Enable runtime PM before registering async sub-device +- media: ov9734: Enable runtime PM before registering async sub-device +- rpmsg: virtio: Free driver_override when rpmsg_remove() +- media: imx355: Enable runtime PM before registering async sub-device +- soc: qcom: pmic_glink_altmode: fix port sanity check +- mtd: rawnand: Clarify conditions to enable continuous reads +- mtd: rawnand: Prevent sequential reads with on-die ECC engines +- mtd: rawnand: Fix core interference with sequential reads +- mtd: rawnand: Prevent crossing LUN boundaries during sequential reads +- mtd: maps: vmu-flash: Fix the (mtd core) switch to ref counters +- PM / devfreq: Fix buffer overflow in trans_stat_show +- s390/vfio-ap: unpin pages on gisc registration failure +- crypto: s390/aes - Fix buffer overread in CTR mode +- hwrng: core - Fix page fault dead lock on mmap-ed hwrng +- PM: hibernate: Enforce ordering during image compression/decompression +- crypto: api - Disallow identical driver names +- crypto: lib/mpi - Fix unexpected pointer access in mpi_ec_init +- btrfs: sysfs: validate scrub_speed_max value +- OPP: Pass rounded rate to _set_opp() +- arm64: properly install vmlinuz.efi +- PM: sleep: Fix possible deadlocks in core system-wide PM code +- async: Introduce async_schedule_dev_nocall() +- async: Split async_schedule_node_domain() +- ext4: allow for the last group to be marked as trimmed +- powerpc/ps3_defconfig: Disable PPC64_BIG_ENDIAN_ELF_ABI_V2 +- cifs: update iface_last_update on each query-and-update +- cifs: handle servers that still advertise multichannel after disabling +- cifs: reconnect worker should take reference on server struct unconditionally +- Revert "cifs: reconnect work should have reference on server struct" +- cifs: handle when server stops supporting multichannel +- cifs: handle when server starts supporting multichannel +- cifs: reconnect work should have reference on server struct +- cifs: handle cases where a channel is closed +- smb: client: fix parsing of SMB3.1.1 POSIX create context +- sh: ecovec24: Rename missed backlight field from fbdev to dev +- scsi: core: Kick the requeue list after inserting when flushing +- riscv: Fix an off-by-one in get_early_cmdline() +- scsi: ufs: core: Remove the ufshcd_hba_exit() call from ufshcd_async_scan() +- dmaengine: idxd: Move dma_free_coherent() out of spinlocked context +- dmaengine: fix NULL pointer in channel unregistration function +- dmaengine: fsl-edma: fix eDMAv4 channel allocation issue +- iio: adc: ad7091r: Enable internal vref if external vref is not supplied +- iio: adc: ad7091r: Allow users to configure device events +- iio: adc: ad7091r: Set alert bit in config register +- net: stmmac: Prevent DSA tags from breaking COE +- net: stmmac: Tx coe sw fallback +- soundwire: fix initializing sysfs for same devices on different buses +- soundwire: bus: introduce controller_id +- serial: core: set missing supported flag for RX during TX GPIO +- serial: core: Simplify uart_get_rs485_mode() +- docs: kernel_feat.py: fix potential command injection +- docs: sparse: add sparse.rst to toctree +- docs: sparse: move TW sparse.txt to TW dev-tools +- Revert "Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"" +- arm64: dts: armada-3720-turris-mox: set irq type for RTC +- Revert "KEYS: encrypted: Add check for strsep" +- riscv: Fix wrong usage of lm_alias() when splitting a huge linear mapping +- i2c: s3c24xx: fix transferring more than one message in polling mode +- i2c: s3c24xx: fix read transfers in polling mode +- ipv6: mcast: fix data-race in ipv6_mc_down / mld_ifc_work +- selftests: mlxsw: qos_pfc: Adjust the test to support 8 lanes +- mlxsw: spectrum_router: Register netdevice notifier before nexthop +- mlxsw: spectrum_acl_tcam: Fix stack corruption +- mlxsw: spectrum_acl_tcam: Fix NULL pointer dereference in error path +- mlxsw: spectrum_acl_erp: Fix error flow of pool allocation failure +- loop: fix the the direct I/O support check when used on top of block devices +- ethtool: netlink: Add missing ethnl_ops_begin/complete +- arm64/ptrace: Don't flush ZA/ZT storage when writing ZA via ptrace +- kdb: Fix a potential buffer overflow in kdb_local() +- io_uring: adjust defer tw counting +- ipvs: avoid stat macros calls from preemptible context +- netfilter: nf_tables: reject NFT_SET_CONCAT with not field length description +- netfilter: nf_tables: skip dead set elements in netlink dump +- netfilter: nf_tables: do not allow mismatch field size and set key length +- netfilter: bridge: replace physindev with physinif in nf_bridge_info +- netfilter: propagate net to nf_bridge_get_physindev +- netfilter: nf_queue: remove excess nf_bridge variable +- netfilter: nfnetlink_log: use proper helper for fetching physinif +- netfilter: nft_limit: do not ignore unsupported flags +- netfilter: nf_tables: reject invalid set policy +- net: netdevsim: don't try to destroy PHC on VFs +- mptcp: relax check on MPC passive fallback +- LoongArch: BPF: Prevent out-of-bounds memory access +- net: dsa: vsc73xx: Add null pointer check to vsc73xx_gpio_probe +- bpf: Reject variable offset alu on PTR_TO_FLOW_KEYS +- net: stmmac: ethtool: Fixed calltrace caused by unbalanced disable_irq_wake calls +- selftests: bonding: Change script interpreter +- drm/amdgpu: fall back to INPUT power for AVG power via INFO IOCTL +- drm/amdkfd: fixes for HMM mem allocation +- ASoC: SOF: ipc4-loader: remove the CPC check warnings +- gpio: mlxbf3: add an error code check in mlxbf3_gpio_probe +- dt-bindings: gpio: xilinx: Fix node address in gpio +- net: ravb: Fix dma_addr_t truncation in error case +- net: tls, fix WARNIING in __sk_msg_free +- bpf: Avoid iter->offset making backward progress in bpf_iter_udp +- bpf: iter_udp: Retry with a larger batch size without going back to the previous bucket +- net: netdev_queue: netdev_txq_completed_mb(): fix wake condition +- net: add more sanity check in virtio_net_hdr_to_skb() +- udp: annotate data-races around up->pending +- net: stmmac: Fix ethool link settings ops for integrated PCS +- block: ensure we hold a queue reference when using queue limits +- mptcp: refine opt_mp_capable determination +- mptcp: use OPTION_MPTCP_MPJ_SYN in subflow_check_req() +- mptcp: use OPTION_MPTCP_MPJ_SYNACK in subflow_finish_connect() +- mptcp: strict validation before using mp_opt->hmac +- mptcp: mptcp_parse_option() fix for MPTCPOPT_MP_JOIN +- ALSA: hda: Properly setup HDMI stream +- net: phy: micrel: populate .soft_reset for KSZ9131 +- net: micrel: Fix PTP frame parsing for lan8841 +- amt: do not use overwrapped cb area +- net: ethernet: ti: am65-cpsw: Fix max mtu to fit ethernet frames +- octeontx2-af: CN10KB: Fix FIFO length calculation for RPM2 +- rxrpc: Fix use of Don't Fragment flag +- net: qualcomm: rmnet: fix global oob in rmnet_policy +- s390/pci: fix max size calculation in zpci_memcpy_toio() +- ASoC: mediatek: sof-common: Add NULL check for normal_link string +- PCI: mediatek-gen3: Fix translation window size calculation +- PCI: keystone: Fix race condition when initializing PHYs +- nvmet-tcp: Fix the H2C expected PDU len calculation +- nvme: trace: avoid memcpy overflow warning +- nvmet: re-fix tracing strncpy() warning +- hisi_acc_vfio_pci: Update migration data pointer correctly on saving/resume +- spi: coldfire-qspi: Remove an erroneous clk_disable_unprepare() from the remove function +- cxl/port: Fix missing target list lock +- perf db-export: Fix missing reference count get in call_path_from_sample() +- serial: apbuart: fix console prompt on qemu +- serial: imx: Correct clock error message in function probe() +- usb: xhci-mtk: fix a short packet issue of gen1 isoc-in transfer +- apparmor: avoid crash when parsed profile name is empty +- apparmor: fix possible memory leak in unpack_trans_table +- cxl/region: fix x9 interleave typo +- perf stat: Fix hard coded LL miss units +- perf env: Avoid recursively taking env->bpf_progs.lock +- nvmet-tcp: fix a crash in nvmet_req_complete() +- nvmet-tcp: Fix a kernel panic when host sends an invalid H2C PDU length +- apparmor: Fix ref count leak in task_kill +- vdpa: Fix an error handling path in eni_vdpa_probe() +- power: supply: Fix null pointer dereference in smb2_probe +- usb: gadget: webcam: Make g_webcam loadable again +- spmi: mtk-pmif: Serialize PMIF status check and command submission +- usb: cdc-acm: return correct error code on unsupported break +- tty: use 'if' in send_break() instead of 'goto' +- tty: don't check for signal_pending() in send_break() +- tty: early return from send_break() on TTY_DRIVER_HARDWARE_BREAK +- PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single() +- bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs +- bus: mhi: ep: Use slab allocator where applicable +- bus: mhi: ep: Do not allocate event ring element on stack +- perf unwind-libunwind: Fix base address for .eh_frame +- perf unwind-libdw: Handle JIT-generated DSOs properly +- perf genelf: Set ELF program header addresses properly +- perf header: Fix one memory leakage in perf_event__fprintf_event_update() +- iio: adc: ad9467: fix scale setting +- iio: adc: ad9467: add mutex to struct ad9467_state +- iio: adc: ad9467: don't ignore error codes +- iio: adc: ad9467: fix reset gpio handling +- selftests/sgx: Skip non X86_64 platform +- selftests/sgx: Include memory clobber for inline asm in test enclave +- selftests/sgx: Fix uninitialized pointer dereferences in encl_get_entry +- selftests/sgx: Fix uninitialized pointer dereference in error path +- serial: imx: fix tx statemachine deadlock +- software node: Let args be NULL in software_node_get_reference_args +- acpi: property: Let args be NULL in __acpi_node_get_property_reference +- base/node.c: initialize the accessor list before registering +- perf stat: Exit perf stat if parse groups fails +- perf mem: Fix error on hybrid related to availability of mem event in a PMU +- perf vendor events arm64 AmpereOne: Rename BPU_FLUSH_MEM_FAULT to GPC_FLUSH_MEM_FAULT +- vfio/pds: Fix calculations in pds_vfio_dirty_sync +- perf test record user-regs: Fix mask for vg register +- libapi: Add missing linux/types.h header to get the __u64 type on io.h +- perf header: Fix segfault on build_mem_topology() error path +- perf test: Remove atomics from test_loop to avoid test failures +- power: supply: bq256xx: fix some problem in bq256xx_hw_init +- power: supply: cw2015: correct time_to_empty units in sysfs +- MIPS: Alchemy: Fix an out-of-bound access in db1550_dev_setup() +- MIPS: Alchemy: Fix an out-of-bound access in db1200_dev_setup() +- riscv: Fixed wrong register in XIP_FIXUP_FLASH_OFFSET macro +- riscv: Fix set_direct_map_default_noflush() to reset _PAGE_EXEC +- riscv: Fix set_memory_XX() and set_direct_map_XX() by splitting huge linear mappings +- riscv: Fix module_alloc() that did not reset the linear mapping permissions +- riscv: Check if the code to patch lies in the exit section +- um: virt-pci: fix platform map offset +- mips: Fix incorrect max_low_pfn adjustment +- mips: dmi: Fix early remap on MIPS32 +- srcu: Use try-lock lockdep annotation for NMI-safe access. +- mfd: intel-lpss: Fix the fractional clock divider flags +- mfd: tps6594: Add null pointer check to tps6594_device_init() +- leds: aw200xx: Fix write to DIM parameter +- leds: aw2013: Select missing dependency REGMAP_I2C +- mfd: syscon: Fix null pointer dereference in of_syscon_register() +- mfd: cs42l43: Correct SoundWire port list +- mfd: rk8xx: fixup devices registration with PLATFORM_DEVID_AUTO +- ARM: 9330/1: davinci: also select PINCTRL +- serial: sc16is7xx: set safe default SPI clock frequency +- serial: sc16is7xx: add check for unsupported SPI modes during probe +- HID: wacom: Correct behavior when processing some confidence == false touches +- HID: sensor-hub: Enable hid core report processing for all devices +- iio: adc: ad7091r: Pass iio_dev to event handler +- KVM: x86/pmu: Reset the PMU, i.e. stop counters, before refreshing +- KVM: x86/pmu: Move PMU reset logic to common x86 code +- KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache +- x86/kvm: Do not try to disable kvmclock if it was not enabled +- PCI: mediatek: Clear interrupt status before dispatching handler +- PCI: dwc: endpoint: Fix dw_pcie_ep_raise_msix_irq() alignment support +- x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS +- PCI/P2PDMA: Remove reference to pci_p2pdma_map_sg() +- cxl/port: Fix decoder initialization when nr_targets > interleave_ways +- Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB" +- Revert "net: rtnetlink: Enslave device before bringing it up" +- net: stmmac: fix ethtool per-queue statistics +- wifi: mwifiex: fix uninitialized firmware_stat +- wifi: mwifiex: configure BSSID consistently when starting AP +- wifi: mwifiex: add extra delay for firmware ready +- wifi: rtlwifi: Convert LNKCTL change to PCIe cap RMW accessors +- wifi: rtlwifi: Remove bogus and dangerous ASPM disable/enable code +- wifi: mt76: fix broken precal loading from MTD for mt7915 +- iommu/arm-smmu-qcom: Add missing GMU entry to match table +- bpf: Fix re-attachment branch in bpf_tracing_prog_attach +- Bluetooth: Fix atomicity violation in {min,max}_key_size_set +- md/raid1: Use blk_opf_t for read and write operations +- pwm: Fix out-of-bounds access in of_pwm_single_xlate() +- pwm: jz4740: Don't use dev_err_probe() in .request() +- netfilter: nf_tables: check if catch-all set element is active in next generation +- block: Fix iterating over an empty bio with bio_for_each_folio_all +- block: Remove special-casing of compound pages +- drm/amd: Enable PCIe PME from D3 +- scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State +- scsi: mpi3mr: Clean up block devices post controller reset +- scsi: mpi3mr: Refresh sdev queue depth after controller reset +- scsi: target: core: add missing file_{start,end}_write() +- scsi: ufs: core: Simplify power management during async scan +- fbdev: flush deferred IO before closing +- fbdev: flush deferred work in fb_deferred_io_fsync() +- fbdev/acornfb: Fix name of fb_ops initializer macro +- io_uring: ensure local task_work is run on wait timeout +- io_uring/rw: ensure io->bytes_done is always initialized +- io_uring: don't check iopoll if request completes +- LoongArch: Fix and simplify fcsr initialization on execve() +- ceph: select FS_ENCRYPTION_ALGS if FS_ENCRYPTION +- ksmbd: only v2 leases handle the directory +- ksmbd: fix UAF issue in ksmbd_tcp_new_connection() +- ksmbd: validate mech token in session setup +- ALSA: hda/realtek: Enable headset mic on Lenovo M70 Gen5 +- ALSA: hda/realtek: Enable mute/micmute LEDs and limit mic boost on HP ZBook +- ALSA: hda/relatek: Enable Mute LED on HP Laptop 15s-fq2xxx +- ALSA: oxygen: Fix right channel of capture volume mixer +- serial: omap: do not override settings for RS485 support +- serial: 8250_exar: Set missing rs485_supported flag +- serial: imx: Ensure that imx_uart_rs485_config() is called with enabled clock +- serial: core, imx: do not set RS485 enabled if it is not supported +- serial: 8250_bcm2835aux: Restore clock error handling +- serial: core: make sure RS485 cannot be enabled when it is not supported +- serial: core: fix sanitizing check for RTS settings +- dt-bindings: phy: qcom,sc8280xp-qmp-usb43dp-phy: fix path to header +- usb: mon: Fix atomicity violation in mon_bin_vma_fault +- usb: typec: class: fix typec_altmode_put_partner to put plugs +- Revert "usb: typec: class: fix typec_altmode_put_partner to put plugs" +- usb: cdns3: Fix uvc fail when DMA cross 4k boundery since sg enabled +- usb: cdns3: fix iso transfer error when mult is not zero +- usb: cdns3: fix uvc failure work since sg support enabled +- usb: chipidea: wait controller resume finished for wakeup irq +- Revert "usb: dwc3: don't reset device side if dwc3 was configured as host-only" +- Revert "usb: dwc3: Soft reset phy on probe for host" +- usb: dwc3: gadget: Queue PM runtime idle on disconnect event +- usb: dwc3: gadget: Handle EP0 request dequeuing properly +- usb: dwc: ep0: Update request status in dwc3_ep0_stall_restart +- usb: phy: mxs: remove CONFIG_USB_OTG condition for mxs_phy_is_otg_host() +- Revert "usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()" +- tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug +- powerpc/64s: Increase default stack size to 32KB +- clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings +- binder: fix race between mmput() and do_exit() +- xen-netback: don't produce zero-size SKB frags +- Revert "drm/amdkfd: Relocate TBA/TMA to opposite side of VM hole" +- rust: Ignore preserve-most functions +- Input: atkbd - use ab83 as id when skipping the getid command +- mips/smp: Call rcutree_report_cpu_starting() earlier +- binder: fix unused alloc->free_async_space +- binder: fix async space check for 0-sized buffers +- keys, dns: Fix size check of V1 server-list header +- selftests/bpf: Add assert for user stacks in test_task_stack +- Revert "kernfs: convert kernfs_idr_lock to an irq safe raw spinlock" +- kernfs: convert kernfs_idr_lock to an irq safe raw spinlock +- class: fix use-after-free in class_register() +- of: unittest: Fix of_count_phandle_with_args() expected value message +- fbdev: imxfb: fix left margin setting +- of: Fix double free in of_parse_phandle_with_args_map +- ksmbd: validate the zero field of packet header +- kselftest/alsa - conf: Stringify the printed errno in sysfs_get() +- kselftest/alsa - mixer-test: Fix the print format specifier warning +- kselftest/alsa - mixer-test: fix the number of parameters to ksft_exit_fail_msg() +- drm/amd/display: avoid stringop-overflow warnings for dp_decide_lane_settings() +- drm/amd/pm/smu7: fix a memleak in smu7_hwmgr_backend_init +- drm/amdkfd: Confirm list is non-empty before utilizing list_first_entry in kfd_topology.c +- IB/iser: Prevent invalidating wrong MR +- gpio: sysfs: drop the mention of gpiochip_find() from sysfs code +- gpiolib: provide gpio_device_find() +- gpiolib: make gpio_device_get() and gpio_device_put() public +- drm/amdkfd: Fix type of 'dbg_flags' in 'struct kfd_process' +- mmc: sdhci_omap: Fix TI SoC dependencies +- mmc: sdhci_am654: Fix TI SoC dependencies +- ALSA: scarlett2: Add clamp() in scarlett2_mixer_ctl_put() +- ALSA: scarlett2: Add missing error checks to *_ctl_get() +- ALSA: scarlett2: Allow passing any output to line_out_remap() +- ALSA: scarlett2: Add missing error check to scarlett2_usb_set_config() +- ALSA: scarlett2: Add missing error check to scarlett2_config_save() +- ASoC: rt5645: Drop double EF20 entry from dmi_platform_data[] +- pwm: stm32: Fix enable count for clk in .probe() +- pwm: stm32: Use hweight32 in stm32_pwm_detect_channels +- clk: fixed-rate: fix clk_hw_register_fixed_rate_with_accuracy_parent_hw +- clk: qcom: dispcc-sm8550: Update disp PLL settings +- clk: qcom: gcc-sm8550: Mark RCGs shared where applicable +- clk: qcom: gcc-sm8550: use collapse-voting for PCIe GDSCs +- clk: qcom: gcc-sm8550: Mark the PCIe GDSCs votable +- clk: qcom: gcc-sm8550: Add the missing RETAIN_FF_ENABLE GDSC flag +- accel/habanalabs: fix information leak in sec_attest_info() +- drm/mediatek: dp: Add phy_mtk_dp module as pre-dependency +- ASoC: tas2781: add support for FW version 0x0503 +- ASoC: amd: vangogh: Drop conflicting ACPI-based probing +- clk: si5341: fix an error code problem in si5341_output_clk_set_rate +- clk: rs9: Fix DIF OEn bit placement on 9FGV0241 +- watchdog: rti_wdt: Drop runtime pm reference count when watchdog is unused +- watchdog: bcm2835_wdt: Fix WDIOC_SETTIMEOUT handling +- watchdog/hpwdt: Only claim UNKNOWN NMI if from iLO +- watchdog: set cdev owner before adding +- drivers: clk: zynqmp: update divider round rate logic +- drivers: clk: zynqmp: calculate closest mux rate +- clk: sp7021: fix return value check in sp7021_clk_probe() +- clk: qcom: videocc-sm8150: Add missing PLL config property +- clk: qcom: videocc-sm8150: Update the videocc resets +- dt-bindings: clock: Update the videocc resets for sm8150 +- f2fs: fix to check return value of f2fs_recover_xattr_data +- drm/amd/pm: fix a double-free in amdgpu_parse_extended_power_table +- gpu/drm/radeon: fix two memleaks in radeon_vm_init +- drivers/amd/pm: fix a use-after-free in kv_parse_power_table +- drm/amd/pm: fix a double-free in si_dpm_init +- drm/amdgpu/debugfs: fix error code when smc register accessors are NULL +- drm/mediatek: Fix underrun in VDO1 when switches off the layer +- drm/mediatek: Remove the redundant driver data for DPI +- drm/mediatek: Return error if MDP RDMA failed to enable the clock +- drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr() +- drm/msm/dpu: Set input_sel bit for INTF +- clk: renesas: rzg2l: Check reset monitor registers +- clk: renesas: rzg2l-cpg: Reuse code in rzg2l_cpg_reset() +- media: dvb-frontends: m88ds3103: Fix a memory leak in an error handling path of m88ds3103_probe() +- media: dvbdev: drop refcount on error path in dvb_device_open() +- f2fs: fix to update iostat correctly in f2fs_filemap_fault() +- f2fs: fix to check compress file in f2fs_move_file_range() +- f2fs: fix to wait on block writeback for post_read case +- drm/panel: st7701: Fix AVCL calculation +- drm/msm/adreno: Fix A680 chip id +- media: rkisp1: Fix media device memory leak +- media: dt-bindings: media: rkisp1: Fix the port description for the parallel interface +- media: imx-mipi-csis: Drop extra clock enable at probe() +- media: imx-mipi-csis: Fix clock handling in remove() +- media: bttv: add back vbi hack +- media: bttv: start_streaming should return a proper error code +- clk: qcom: gpucc-sm8150: Update the gpu_cc_pll1 config +- media: cx231xx: fix a memleak in cx231xx_init_isoc +- drm/bridge: tc358767: Fix return value on error case +- drm/bridge: cdns-mhdp8546: Fix use of uninitialized variable +- drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table +- drm/radeon/dpm: fix a memleak in sumo_parse_power_table +- drm/msm/dpu: correct clk bit for WB2 block +- drm/panfrost: Ignore core_mask for poweroff and disable PWRTRANS irq +- ASoC: SOF: topology: Use partial match for disconnecting DAI link and DAI widget +- ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL +- ASoC: Intel: glk_rt5682_max98357a: fix board id mismatch +- media: v4l: async: Fix duplicated list deletion +- drm/drv: propagate errors from drm_modeset_register_all() +- drm/msm/dsi: Use pm_runtime_resume_and_get to prevent refcnt leaks +- drm/msm/dpu: Add missing safe_lut_tbl in sc8180x catalog +- drm/msm/mdp4: flush vblank event on disable +- ASoC: cs35l33: Fix GPIO name and drop legacy include +- drm/imx/lcdc: Fix double-free of driver data +- drm/tidss: Fix dss reset +- drm/tidss: Check for K2G in in dispc_softreset() +- drm/tidss: Return error value from from softreset +- drm/tidss: Move reset to the end of dispc_init() +- drm/radeon: check return value of radeon_ring_lock() +- drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check() +- drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg() +- drm/bridge: Fix typo in post_disable() description +- media: amphion: Fix VPU core alias name +- media: rkvdec: Hook the (TRY_)DECODER_CMD stateless ioctls +- media: verisilicon: Hook the (TRY_)DECODER_CMD stateless ioctls +- media: visl: Hook the (TRY_)DECODER_CMD stateless ioctls +- media: mtk-jpeg: Remove cancel worker in mtk_jpeg_remove to avoid the crash of multi-core JPEG devices +- media: pvrusb2: fix use after free on context disconnection +- drm/tilcdc: Fix irq free on unload +- drm/bridge: tpd12s015: Drop buggy __exit annotation for remove function +- drm/nouveau/fence:: fix warning directly dereferencing a rcu pointer +- drm/panel-elida-kd35t133: hold panel in reset for unprepare +- drm/panel: nv3051d: Hold panel in reset for unprepare +- RDMA/usnic: Silence uninitialized symbol smatch warnings +- drm/panfrost: Really power off GPU cores in panfrost_gpu_power_off() +- drm/dp_mst: Fix fractional DSC bpp handling +- Revert "drm/omapdrm: Annotate dma-fence critical section in commit path" +- Revert "drm/tidss: Annotate dma-fence critical section in commit path" +- ARM: davinci: always select CONFIG_CPU_ARM926T +- ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim() +- rxrpc: Fix skbuff cleanup of call's recvmsg_queue and rx_oos_queue +- mlxbf_gige: Enable the GigE port in mlxbf_gige_open +- mlxbf_gige: Fix intermittent no ip issue +- net/sched: act_ct: fix skb leak and crash on ooo frags +- blk-cgroup: fix rcu lockdep warning in blkg_lookup() +- sctp: fix busy polling +- sctp: support MSG_ERRQUEUE flag in recvmsg() +- bpf: sockmap, fix proto update hook to avoid dup calls +- wifi: cfg80211: parse all ML elements in an ML probe response +- wifi: cfg80211: correct comment about MLD ID +- arm64: dts: rockchip: Fix led pinctrl of lubancat 1 +- null_blk: don't cap max_hw_sectors to BLK_DEF_MAX_SECTORS +- Bluetooth: btmtkuart: fix recv_buf() return value +- Bluetooth: btnxpuart: fix recv_buf() return value +- Bluetooth: Fix bogus check for re-auth no supported with non-ssp +- netfilter: nf_tables: validate chain type update if available +- netfilter: nf_tables: mark newset as dead on transaction abort +- wifi: iwlwifi: assign phy_ctxt before eSR activation +- wifi: iwlwifi: fix out of bound copy_from_user +- wifi: iwlwifi: mvm: send TX path flush in rfkill +- wifi: iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request +- wifi: rtlwifi: rtl8192se: using calculate_bit_shift() +- wifi: rtlwifi: rtl8192ee: using calculate_bit_shift() +- wifi: rtlwifi: rtl8192de: using calculate_bit_shift() +- wifi: rtlwifi: rtl8192ce: using calculate_bit_shift() +- wifi: rtlwifi: rtl8192cu: using calculate_bit_shift() +- wifi: rtlwifi: rtl8192c: using calculate_bit_shift() +- wifi: rtlwifi: rtl8188ee: phy: using calculate_bit_shift() +- wifi: rtlwifi: add calculate_bit_shift() +- bpf: Use c->unit_size to select target cache during free +- bpf: Use pcpu_alloc_size() in bpf_mem_free{_rcu}() +- bpf: Re-enable unit_size checking for global per-cpu allocator +- arm64: dts: qcom: sc8180x: Fix up PCIe nodes +- arm64: dts: qcom: sc8180x: switch PCIe QMP PHY to new style of bindings +- arm64: dts: qcom: sc8180x: Mark PCIe hosts cache-coherent +- arm64: dts: qcom: sm8550: Update idle state time requirements +- arm64: dts: qcom: sm8550: Separate out X3 idle state +- arm64: dts: qcom: ipq6018: fix clock rates for GCC_USB0_MOCK_UTMI_CLK +- arm64: dts: qcom: sc7280: Mark SDHCI hosts as cache-coherent +- soc: qcom: llcc: Fix LLCC_TRP_ATTR2_CFGn offset +- arm64: dts: qcom: sm8150-hdk: fix SS USB regulators +- arm64: dts: qcom: sm8150: make dispcc cast minimal vote on MMCX +- arm64: dts: qcom: sm6375: Hook up MPM +- arm64: dts: qcom: sm6375: fix USB wakeup interrupt types +- soc: qcom: llcc: Fix dis_cap_alloc and retain_on_pc configuration +- arm64: dts: qcom: acer-aspire1: Correct audio codec definition +- bpf: Limit the number of kprobes when attaching program to multiple kprobes +- bpf: Limit the number of uprobes when attaching program to multiple uprobes +- dma-mapping: clear dev->dma_mem to NULL after freeing it +- virtio/vsock: send credit update during setting SO_RCVLOWAT +- virtio/vsock: fix logic which reduces credit update messages +- ipmr: support IP_PKTINFO on cache report IGMP msg +- selftests/net: fix grep checking for fib_nexthop_multiprefix +- bpf: Fix a race condition between btf_put() and map_free() +- ARM: dts: stm32: don't mix SCMI and non-SCMI board compatibles +- scsi: hisi_sas: Correct the number of global debugfs registers +- scsi: hisi_sas: Rollback some operations if FLR failed +- scsi: hisi_sas: Check before using pointer variables +- scsi: hisi_sas: Replace with standard error code return value +- scsi: ufs: qcom: Fix the return value when platform_get_resource_byname() fails +- scsi: ufs: qcom: Fix the return value of ufs_qcom_ice_program_key() +- arm64: dts: imx8mm: Reduce GPU to nominal speed +- arm64: dts: renesas: white-hawk-cpu: Fix missing serial console pin control +- arm64: dts: xilinx: Apply overlays to base dtbs +- selftests/bpf: Relax time_tai test for equal timestamps in tai_forward +- wifi: iwlwifi: don't support triggered EHT CQI feedback +- wifi: mt76: mt7921: fix country count limitation for CLC +- arm64: dts: mediatek: mt8186: fix address warning for ADSP mailboxes +- arm64: dts: mediatek: mt8186: Fix alias prefix for ovl_2l0 +- arm64: dts: mediatek: mt8195: revise VDOSYS RDMA node name +- arm64: dts: mediatek: mt8183: correct MDP3 DMA-related nodes +- dt-bindings: media: mediatek: mdp3: correct RDMA and WROT node with generic names +- bpf: Fix accesses to uninit stack slots +- bpf: Guard stack limits against 32bit overflow +- arm64: dts: hisilicon: hikey970-pmic: fix regulator cells properties +- bpf: Fix verification of indirect var-off stack access +- wifi: mt76: mt7921s: fix workqueue problem causes STA association fail +- wifi: mt76: mt7915: also MT7981 is 3T3R but nss2 on 5 GHz band +- wifi: mt76: mt7915: fix EEPROM offset of TSSI flag on MT7981 +- wifi: mt76: mt7996: fix rate usage of inband discovery frames +- wifi: mt76: mt7996: fix the size of struct bss_rate_tlv +- wifi: mt76: mt7915: fallback to non-wed mode if platform_get_resource fails in mt7915_mmio_wed_init() +- wifi: mt76: fix typo in mt76_get_of_eeprom_from_nvmem function +- arm64: dts: qcom: sm8550: fix USB wakeup interrupt types +- arm64: dts: qcom: sc7280: fix usb_2 wakeup interrupt types +- arm64: dts: qcom: sa8775p: fix USB wakeup interrupt types +- arm64: dts: qcom: sc7280: Mark Adreno SMMU as DMA coherent +- arm64: dts: qcom: sc7280: Fix up GPU SIDs +- arm64: dts: qcom: sm8350: Fix DMA0 address +- arm64: dts: qcom: sm6125: add interrupts to DWC3 USB controller +- arm64: dts: qcom: sdm845-db845c: correct LED panic indicator +- arm64: dts: qcom: qrb5165-rb5: correct LED panic indicator +- arm64: dts: qcom: qrb2210-rb1: use USB host mode +- arm64: dts: qcom: qrb2210-rb1: Hook up USB3 +- scsi: fnic: Return error if vmalloc() failed +- bpf: fix check for attempt to corrupt spilled pointer +- selftests/net: specify the interface when do arping +- bpf: Defer the free of inner map when necessary +- bpf: Add map and need_defer parameters to .map_fd_put_ptr() +- arm64: dts: qcom: sm6350: Make watchdog bark interrupt edge triggered +- arm64: dts: qcom: sc8280xp: Make watchdog bark interrupt edge triggered +- arm64: dts: qcom: sa8775p: Make watchdog bark interrupt edge triggered +- arm64: dts: qcom: sm8250: Make watchdog bark interrupt edge triggered +- arm64: dts: qcom: sm8150: Make watchdog bark interrupt edge triggered +- arm64: dts: qcom: sdm845: Make watchdog bark interrupt edge triggered +- arm64: dts: qcom: sc7280: Make watchdog bark interrupt edge triggered +- arm64: dts: qcom: sc7280: Mark some nodes as 'reserved' +- arm64: dts: qcom: sc7180: Make watchdog bark interrupt edge triggered +- arm64: dts: qcom: sm8550: correct TX Soundwire clock +- arm64: dts: qcom: sm8450: correct TX Soundwire clock +- arm64: dts: qcom: sc8180x-primus: Fix HALL_INT polarity +- dt-bindings: arm: qcom: Fix html link +- ARM: dts: qcom: sdx65: correct SPMI node name +- ARM: dts: qcom: sdx65: correct PCIe EP phy-names +- bpf: enforce precision of R0 on callback return +- selftests/bpf: Fix erroneous bitmask operation +- wifi: rtw88: sdio: Honor the host max_req_size in the RX path +- arm64: dts: ti: iot2050: Re-add aliases +- arm64: dts: ti: k3-am65-main: Fix DSS irq trigger type +- arm64: dts: ti: k3-am62a-main: Fix GPIO pin count in DT nodes +- wifi: rtlwifi: rtl8821ae: phy: fix an undefined bitwise shift behavior +- scsi: bfa: Use the proper data type for BLIST flags +- firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create() +- net/ncsi: Fix netlink major/minor version numbers +- ARM: dts: qcom: apq8064: correct XOADC register address +- wifi: libertas: stop selecting wext +- wifi: ath11k: Defer on rproc_get failure +- bpf: Add crosstask check to __bpf_get_stack +- bpf, lpm: Fix check prefixlen before walking trie +- wifi: rtw88: fix RX filter in FIF_ALLMULTI flag +- wifi: plfxlc: check for allocation failure in plfxlc_usb_wreq_async() +- ARM: dts: qcom: msm8226: provide dsi phy clocks to mmcc +- arm64: dts: qcom: sc8280xp-x13s: add missing camera LED pin config +- arm64: dts: qcom: sc8280xp-x13s: Use the correct DP PHY compatible +- arm64: dts: qcom: qrb4210-rb2: don't force usb peripheral mode +- asm-generic: Fix 32 bit __generic_cmpxchg_local +- pNFS: Fix the pnfs block driver's calculation of layoutget size +- SUNRPC: fix _xprt_switch_find_current_entry logic +- NFSv4.1/pnfs: Ensure we handle the error NFS4ERR_RETURNCONFLICT +- NFS: Use parent's objective cred in nfs_access_login_time() +- blocklayoutdriver: Fix reference leak of pnfs_device_node +- csky: fix arch_jump_label_transform_static override +- crypto: scomp - fix req->dst buffer overflow +- crypto: sahara - do not resize req->src when doing hash operations +- crypto: sahara - fix processing hash requests with req->nbytes < sg->length +- crypto: sahara - improve error handling in sahara_sha_process() +- crypto: sahara - fix wait_for_completion_timeout() error handling +- crypto: sahara - fix ahash reqsize +- crypto: sahara - handle zero-length aes requests +- crypto: sahara - avoid skcipher fallback code duplication +- crypto: virtio - Wait for tasklet to complete on device remove +- dlm: fix format seq ops type 4 +- gfs2: fix kernel BUG in gfs2_quota_cleanup +- fs: indicate request originates from old mount API +- erofs: fix memory leak on short-lived bounced pages +- pstore: ram_core: fix possible overflow in persistent_ram_init_ecc() +- crypto: sahara - fix error handling in sahara_hw_descriptor_create() +- crypto: sahara - fix processing requests with cryptlen < sg->length +- crypto: sahara - fix ahash selftest failure +- crypto: sahara - fix cbc selftest failure +- crypto: sahara - remove FLAGS_NEW_KEY logic +- crypto: safexcel - Add error handling for dma_map_sg() calls +- crypto: af_alg - Disallow multiple in-flight AIO requests +- crypto: ccp - fix memleak in ccp_init_dm_workarea +- crypto: sa2ul - Return crypto_aead_setkey to transfer the error +- crypto: virtio - Handle dataq logic with tasklet +- crypto: jh7110 - Correct deferred probe return +- crypto: rsa - add a check for allocation failure +- selinux: Fix error priority for bind with AF_UNSPEC on PF_INET6 socket +- drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment +- cpuidle: haltpoll: Do not enable interrupts when entering idle +- kunit: debugfs: Fix unchecked dereference in debugfs_print_results() +- thermal: core: Fix NULL pointer dereference in zone registration error path +- ACPI: extlog: Clear Extended Error Log status when RAS_CEC handled the error +- ACPI: LPSS: Fix the fractional clock divider flags +- spi: sh-msiof: Enforce fixed DTDL for R-Car H3 +- efivarfs: Free s_fs_info on unmount +- calipso: fix memory leak in netlbl_calipso_add_pass() +- cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() +- platform/x86/intel/vsec: Fix xa_alloc memory leak +- spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe() +- KEYS: encrypted: Add check for strsep +- ACPI: LPIT: Avoid u32 multiplication overflow +- ACPI: video: check for error while searching for backlight device parent +- mtd: rawnand: Increment IFC_TIMEOUT_MSECS for nand controller response +- spi: spi-zynqmp-gqspi: fix driver kconfig dependencies +- perf/x86/intel/uncore: Fix NULL pointer dereference issue in upi_fill_topology() +- sched/fair: Update min_vruntime for reweight_entity() correctly +- powerpc/imc-pmu: Add a null pointer check in update_events_in_group() +- powerpc/powernv: Add a null pointer check in opal_powercap_init() +- powerpc/powernv: Add a null pointer check in opal_event_init() +- powerpc/powernv: Add a null pointer check to scom_debug_init_one() +- powerpc/rtas: Avoid warning on invalid token argument to sys_rtas() +- powerpc/hv-gpci: Add return value check in affinity_domain_via_partition_show function +- selftests/powerpc: Fix error handling in FPU/VMX preemption tests +- KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE +- KVM: PPC: Book3S HV: Introduce low level MSR accessor +- KVM: PPC: Book3S HV: Use accessors for VCPU registers +- drivers/perf: hisi: Fix some event id for HiSilicon UC pmu +- perf/arm-cmn: Fix HN-F class_occup_id events +- powerpc/pseries/memhp: Fix access beyond end of drmem array +- powerpc/44x: select I2C for CURRITUCK +- x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram +- powerpc: add crtsavres.o to always-y instead of extra-y +- EDAC/thunderx: Fix possible out-of-bounds string access +- x86/mce/inject: Clear test status value +- x86/lib: Fix overflow when counting digits +- mm/memory_hotplug: fix memmap_on_memory sysfs value retrieval +- scripts/decode_stacktrace.sh: optionally use LLVM utilities +- coresight: etm4x: Fix width of CCITMIN field +- PCI: Add ACS quirk for more Zhaoxin Root Ports +- leds: ledtrig-tty: Free allocated ttyname buffer on deactivate +- parport: parport_serial: Add Brainboxes device IDs and geometry +- parport: parport_serial: Add Brainboxes BAR details +- uio: Fix use-after-free in uio_open +- binder: fix comment on binder_alloc_new_buf() return value +- binder: fix trivial typo of binder_free_buf_locked() +- binder: fix use-after-free in shinker's callback +- binder: use EPOLLERR from eventpoll.h +- ksmbd: free ppace array on error in parse_dacl +- ksmbd: don't allow O_TRUNC open on read-only share +- drm/amd/display: Pass pwrseq inst for backlight and ABM +- ASoC: SOF: Intel: hda-codec: Delay the codec device registration +- bus: moxtet: Add spi device table +- bus: moxtet: Mark the irq as shared +- ACPI: resource: Add another DMI match for the TongFang GMxXGxx +- ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP Envy X360 13-ay0xxx +- drm/crtc: fix uninitialized variable use +- x86/csum: clean up `csum_partial' further +- x86/csum: Remove unnecessary odd handling +- ARM: sun9i: smp: fix return code check of of_property_match_string +- connector: Fix proc_event_num_listeners count not cleared +- net: qrtr: ns: Return 0 if server port is not present +- nfc: Do not send datagram if socket state isn't LLCP_BOUND +- virtio_blk: fix snprintf truncation compiler warning +- ida: Fix crash in ida_free when the bitmap is empty +- posix-timers: Get rid of [COMPAT_]SYS_NI() uses +- pinctrl: cy8c95x0: Fix get_pincfg +- pinctrl: cy8c95x0: Fix regression +- pinctrl: cy8c95x0: Fix typo +- drm/amd/display: get dprefclk ss info from integration info table +- drm/amd/display: Add case for dcn35 to support usb4 dmub hpd event +- drm/amdkfd: svm range always mapped flag not working on APU +- i2c: rk3x: fix potential spinlock recursion on poll +- smb: client: fix potential OOB in smb2_dump_detail() +- HID: nintendo: Prevent divide-by-zero on code +- dm audit: fix Kconfig so DM_AUDIT depends on BLK_DEV_DM +- ALSA: hda/realtek: Add quirks for ASUS Zenbook 2022 Models +- ASoC: Intel: bytcr_rt5640: Add new swapped-speakers quirk +- ASoC: Intel: bytcr_rt5640: Add quirk for the Medion Lifetab S10346 +- platform/x86/amd/pmc: Disable keyboard wakeup on AMD Framework 13 +- platform/x86/amd/pmc: Move keyboard wakeup disablement detection to pmc-quirks +- platform/x86/amd/pmc: Only run IRQ1 firmware version check on Cezanne +- platform/x86/amd/pmc: Move platform defines to header +- platform/x86: thinkpad_acpi: fix for incorrect fan reporting on some ThinkPad systems +- HID: nintendo: fix initializer element is not constant error +- kselftest: alsa: fixed a print formatting warning +- driver core: Add a guard() definition for the device_lock() +- Input: xpad - add Razer Wolverine V2 support +- wifi: iwlwifi: pcie: avoid a NULL pointer dereference +- ARC: fix smatch warning +- ARC: fix spare error +- s390/scm: fix virtual vs physical address confusion +- ASoC: cs35l45: Prevents spinning during runtime suspend +- ASoC: cs35l45: Prevent IRQ handling when suspending/resuming +- ASoC: cs35l45: Use modern pm_ops +- pinctrl: amd: Mask non-wake source pins with interrupt enabled at suspend +- Input: i8042 - add nomux quirk for Acer P459-G2-M +- Input: atkbd - skip ATKBD_CMD_GETID in translated mode +- reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning +- Input: psmouse - enable Synaptics InterTouch for ThinkPad L14 G1 +- ring-buffer: Do not record in NMI if the arch does not support cmpxchg in NMI +- tracing: Fix uaf issue when open the hist or hist_debug file +- MIPS: dts: loongson: drop incorrect dwmac fallback compatible +- stmmac: dwmac-loongson: drop useless check for compatible fallback +- tracing: Add size check when printing trace_marker output +- tracing: Have large events show up as '[LINE TOO BIG]' instead of nothing +- jbd2: fix soft lockup in journal_finish_inode_data_buffers() +- efi/loongarch: Use load address to calculate kernel entry address +- platform/x86: intel-vbtn: Fix missing tablet-mode-switch events +- neighbour: Don't let neigh_forced_gc() disable preemption for long +- drm/crtc: Fix uninit-value bug in drm_mode_setcrtc +- jbd2: increase the journal IO's priority +- jbd2: correct the printing of write_flags in jbd2_write_superblock() +- soundwire: intel_ace2x: fix AC timing setting for ACE2.x +- clk: rockchip: rk3128: Fix HCLK_OTG gate register +- clk: rockchip: rk3568: Add PLL rate for 292.5MHz +- LoongArch: Preserve syscall nr across execve() +- LoongArch: Set unwind stack type to unknown rather than set error flag +- LoongArch: Apply dynamic relocations for LLD +- hwmon: (corsair-psu) Fix probe when built-in +- ALSA: pcmtest: stop timer before buffer is released +- drm/exynos: fix a wrong error checking +- drm/exynos: fix a potential error pointer dereference +- drm/amdgpu: Add NULL checks for function pointers +- drm/amd/display: Add monitor patch for specific eDP +- arm64: dts: rockchip: Fix PCI node addresses on rk3399-gru +- nvme: fix deadlock between reset and scan +- nvme: prevent potential spectre v1 gadget +- nvme-ioctl: move capable() admin check to the end +- nvme: ensure reset state check ordering +- nvme: introduce helper function to get ctrl state +- ASoC: da7219: Support low DC impedance headset +- net/tg3: fix race condition in tg3_reset_task() +- pds_vdpa: set features order +- pds_vdpa: clear config callback when status goes to 0 +- pds_vdpa: fix up format-truncation complaint +- ASoC: SOF: ipc4-topology: Correct data structures for the GAIN module +- ASoC: SOF: ipc4-topology: Correct data structures for the SRC module +- ASoC: hdac_hda: Conditionally register dais for HDMI and Analog +- ASoC: amd: yc: Add DMI entry to support System76 Pangolin 13 +- nouveau/tu102: flush all pdbs on vmm flush +- ASoC: SOF: sof-audio: Modify logic for enabling/disabling topology cores +- ASoC: SOF: ipc4-topology: Add core_mask in struct snd_sof_pipeline +- ASoC: Intel: skl_hda_dsp_generic: Drop HDMI routes when HDMI is not available +- ASoC: fsl_xcvr: refine the requested phy clock frequency +- ASoC: rt5650: add mutex to avoid the jack detection failure +- ASoC: fsl_xcvr: Enable 2 * TX bit clock for spdif only case +- ASoC: cs43130: Fix incorrect frame delay configuration +- ASoC: cs43130: Fix the position of const qualifier +- ASoC: Intel: Skylake: mem leak in skl register function +- ASoC: SOF: topology: Fix mem leak in sof_dai_load() +- ASoC: nau8822: Fix incorrect type in assignment and cast to restricted __be16 +- ASoC: Intel: Skylake: Fix mem leak in few functions +- arm64: dts: rockchip: fix rk356x pcie msg interrupt name +- ASoC: wm8974: Correct boost mixer inputs +- ASoC: amd: yc: Add HP 255 G10 into quirk table +- nvme-core: check for too small lba shift +- blk-mq: don't count completed flush data request as inflight in case of quiesce +- smb: client, common: fix fortify warnings +- drm/amdgpu: Use another offset for GC 9.4.3 remap +- drm/amdkfd: Free gang_ctx_bo and wptr_bo in pqm_uninit +- drm/amdgpu: Fix cat debugfs amdgpu_regs_didt causes kernel null pointer +- drm/amd/display: update dcn315 lpddr pstate latency +- drm/amdkfd: Use common function for IP version check +- drm/amdgpu: Do not issue gpu reset from nbio v7_9 bif interrupt +- block: warn once for each partition in bio_check_ro() +- io_uring: use fget/fput consistently +- nvme-core: fix a memory leak in nvme_ns_info_from_identify() +- ALSA: hda: intel-nhlt: Ignore vbps when looking for DMIC 32 bps format +- debugfs: fix automount d_fsdata usage +- wifi: mac80211: handle 320 MHz in ieee80211_ht_cap_ie_to_sta_ht_cap +- wifi: avoid offset calculation on NULL pointer +- wifi: cfg80211: lock wiphy mutex for rfkill poll +- mptcp: fix uninit-value in mptcp_incoming_options +- ALSA: hda - Fix speaker and headset mic pin config for CHUWI CoreBook XPro +- pinctrl: lochnagar: Don't build on MIPS +- pinctrl: s32cc: Avoid possible string truncation +- nfsd: drop the nfsd_put helper +- media: qcom: camss: Comment CSID dt_id field +- cxl/memdev: Hold region_rwsem during inject and clear poison ops +- cxl/hdm: Fix a benign lockdep splat +- cxl: Add cxl_num_decoders_committed() usage to cxl_test +- mmc: sdhci-sprd: Fix eMMC init failure after hw reset +- mmc: core: Cancel delayed work before releasing host +- mmc: rpmb: fixes pause retune on all RPMB partitions. +- mmc: meson-mx-sdhc: Fix initialization frozen issue +- drm/amd/display: Fix sending VSC (+ colorimetry) packets for DP/eDP displays without PSR +- drm/amd/display: add nv12 bounding box +- drm/amdgpu: skip gpu_info fw loading on navi12 +- mm: fix unmap_mapping_range high bits shift bug +- i2c: core: Fix atomic xfer check for non-preempt config +- x86/kprobes: fix incorrect return address calculation in kprobe_emulate_call_indirect +- firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards +- mm/mglru: skip special VMAs in lru_gen_look_around() +- net: constify sk_dst_get() and __sk_dst_get() argument +- cxl/pmu: Ensure put_device on pmu devices +- net: prevent mss overflow in skb_segment() +- powerpc/pseries/vas: Migration suspend waits for no in-progress open windows +- RISCV: KVM: update external interrupt atomically for IMSIC swfile +- dmaengine: fsl-edma: fix wrong pointer check in fsl_edma3_attach_pd() +- dmaengine: idxd: Protect int_handle field in hw descriptor +- drm/amd/display: Increase frame warning limit with KASAN or KCSAN in dml +- kernel/resource: Increment by align value in get_free_mem_region() +- cxl/core: Always hold region_rwsem while reading poison lists +- cxl: Add cxl_decoders_committed() helper +- drm/amd/display: Increase num voltage states to 40 +- drm/i915: Call intel_pre_plane_updates() also for pipes getting enabled +- clk: rockchip: rk3128: Fix SCLK_SDMMC's clock name +- clk: rockchip: rk3128: Fix aclk_peri_src's parent +- phy: sunplus: return negative error code in sp_usb_phy_probe +- phy: mediatek: mipi: mt8183: fix minimal supported frequency +- iio: imu: adis16475: use bit numbers in assign_bit() +- dmaengine: fsl-edma: Add judgment on enabling round robin arbitration +- dmaengine: fsl-edma: Do not suspend and resume the masked dma channel when the system is sleeping +- dmaengine: ti: k3-psil-am62a: Fix SPI PDMA data +- dmaengine: ti: k3-psil-am62: Fix SPI PDMA data +- phy: ti: gmii-sel: Fix register offset when parent is not a syscon node +- KVM: s390: vsie: fix wrong VIR 37 when MSO is used +- riscv: don't probe unaligned access speed if already done +- rcu/tasks-trace: Handle new PF_IDLE semantics +- rcu/tasks: Handle new PF_IDLE semantics +- rcu: Introduce rcu_cpu_online() +- rcu: Break rcu_node_0 --> &rq->__lock order +- ACPI: thermal: Fix acpi_thermal_unregister_thermal_zone() cleanup +- RDMA/mlx5: Fix mkey cache WQ flush +- clk: si521xx: Increase stack based print buffer size in probe +- vfio/mtty: Overhaul mtty interrupt handling +- crypto: qat - fix double free during reset +- crypto: xts - use 'spawn' for underlying single-block cipher +- bpftool: Align output skeleton ELF code +- bpftool: Fix -Wcast-qual warning +- tcp: derive delack_max from rto_min +- media: qcom: camss: Fix genpd cleanup +- media: qcom: camss: Fix V4L2 async notifier error path +- xsk: add multi-buffer support for sockets sharing umem +- mm/memory-failure: pass the folio and the page to collect_procs() +- mm: convert DAX lock/unlock page to lock/unlock folio +- net: Implement missing SO_TIMESTAMPING_NEW cmsg support +- bnxt_en: Remove mis-applied code from bnxt_cfg_ntp_filters() +- net: ravb: Wait for operating mode to be applied +- asix: Add check for usbnet_get_endpoints +- octeontx2-af: Re-enable MAC TX in otx2_stop processing +- octeontx2-af: Always configure NIX TX link credits based on max frame size +- net/smc: fix invalid link access in dumping SMC-R connections +- net/qla3xxx: fix potential memleak in ql_alloc_buffer_queues +- virtio_net: fix missing dma unmap for resize +- virtio_net: avoid data-races on dev->stats fields +- apparmor: Fix move_mount mediation by detecting if source is detached +- igc: Fix hicredit calculation +- i40e: Restore VF MSI-X state during PCI reset +- ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux +- ASoC: meson: g12a-toacodec: Fix event generation +- ASoC: meson: g12a-tohdmitx: Validate written enum values +- ASoC: meson: g12a-toacodec: Validate written enum values +- i40e: fix use-after-free in i40e_aqc_add_filters() +- net: Save and restore msg_namelen in sock_sendmsg +- netfilter: nft_immediate: drop chain reference counter on error +- netfilter: nf_nat: fix action not being set for all ct states +- net: bcmgenet: Fix FCS generation for fragmented skbuffs +- sfc: fix a double-free bug in efx_probe_filters +- ARM: sun9i: smp: Fix array-index-out-of-bounds read in sunxi_mc_smp_init +- selftests: bonding: do not set port down when adding to bond +- net: Implement missing getsockopt(SO_TIMESTAMPING_NEW) +- r8169: Fix PCI error on system resume +- net: sched: em_text: fix possible memory leak in em_text_destroy() +- mlxbf_gige: fix receive packet race condition +- ASoC: mediatek: mt8186: fix AUD_PAD_TOP register and offset +- ASoC: fsl_rpmsg: Fix error handler with pm_runtime_enable +- igc: Check VLAN EtherType mask +- igc: Check VLAN TCI mask +- igc: Report VLAN EtherType matching back to user +- i40e: Fix filter input checks to prevent config with invalid values +- ice: Shut down VSI with "link-down-on-close" enabled +- ice: Fix link_down_on_close message +- drm/i915/perf: Update handling of MMIO triggered reports +- drm/i915/dp: Fix passing the correct DPCD_REV for drm_dp_set_phy_test_pattern +- octeontx2-af: Fix marking couple of structure as __packed +- nfc: llcp_core: Hold a ref to llcp_local->dev when holding a ref to llcp_local +- netfilter: nf_tables: set transport offset from mac header for netdev/egress +- drm/bridge: ps8640: Fix size mismatch warning w/ len +- drm/bridge: ti-sn65dsi86: Never store more than msg->size bytes in AUX xfer +- drm/bridge: parade-ps8640: Never store more than msg->size bytes in AUX xfer +- wifi: iwlwifi: pcie: don't synchronize IRQs from IRQ +- accel/qaic: Implement quirk for SOC_HW_VERSION +- accel/qaic: Fix GEM import path code +- KVM: x86/pmu: fix masking logic for MSR_CORE_PERF_GLOBAL_CTRL +- cifs: do not depend on release_iface for maintaining iface_list +- cifs: cifs_chan_is_iface_active should be called with chan_lock held +- drm/mgag200: Fix gamma lut not initialized for G200ER, G200EV, G200SE +- Revert "PCI/ASPM: Remove pcie_aspm_pm_state_change()" +- mptcp: prevent tcp diag from closing listener subflows +- drm/amd/display: pbn_div need be updated for hotplug event +- ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP ProBook 440 G6 +- ALSA: hda/realtek: fix mute/micmute LEDs for a HP ZBook +- ALSA: hda/realtek: enable SND_PCI_QUIRK for hp pavilion 14-ec1xxx series +- ALSA: hda/tas2781: remove sound controls in unbind +- ALSA: hda/tas2781: move set_drv_data outside tasdevice_init +- ALSA: hda/tas2781: do not use regcache +- keys, dns: Fix missing size check of V1 server-list header +- Revert "platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe" +- netfilter: nf_tables: skip set commit for deleted/destroyed sets +- wifi: nl80211: fix deadlock in nl80211_set_cqm_rssi (6.6.x) +- wifi: cfg80211: fix CQM for non-range use +- tracing: Fix blocked reader of snapshot buffer +- ftrace: Fix modification of direct_function hash while in use +- ring-buffer: Fix wake ups when buffer_percent is set to 100 +- Revert "nvme-fc: fix race between error recovery and creating association" +- mm/memory-failure: check the mapcount of the precise page +- mm/memory-failure: cast index to loff_t before shifting it +- mm: migrate high-order folios in swap cache correctly +- mm/filemap: avoid buffered read/write race to read inconsistent data +- selftests: secretmem: floor the memory size to the multiple of page_size +- maple_tree: do not preallocate nodes for slot stores +- platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe +- platform/x86/intel/pmc: Move GBE LTR ignore to suspend callback +- platform/x86/intel/pmc: Allow reenabling LTRs +- platform/x86/intel/pmc: Add suspend callback +- block: renumber QUEUE_FLAG_HW_WC +- mptcp: fix inconsistent state on fastopen race +- mptcp: fix possible NULL pointer dereference on close +- mptcp: refactor sndbuf auto-tuning +- linux/export: Ensure natural alignment of kcrctab array +- linux/export: Fix alignment for 64-bit ksymtab entries +- kexec: select CRYPTO from KEXEC_FILE instead of depending on it +- kexec: fix KEXEC_FILE dependencies +- virtio_ring: fix syncs DMA memory with different direction +- fs: cifs: Fix atime update check +- client: convert to new timestamp accessors +- fs: new accessor methods for atime and mtime +- ksmbd: avoid duplicate opinfo_put() call on error of smb21_lease_break_ack() +- ksmbd: lazy v2 lease break on smb2_write() +- ksmbd: send v2 lease break notification for directory +- ksmbd: downgrade RWH lease caching state to RH for directory +- ksmbd: set v2 lease capability +- ksmbd: set epoch in create context v2 lease +- ksmbd: don't update ->op_state as OPLOCK_STATE_NONE on error +- ksmbd: move setting SMB2_FLAGS_ASYNC_COMMAND and AsyncId +- ksmbd: release interim response after sending status pending response +- ksmbd: move oplock handling after unlock parent dir +- ksmbd: separately allocate ci per dentry +- ksmbd: prevent memory leak on error return +- ksmbd: fix kernel-doc comment of ksmbd_vfs_kern_path_locked() +- ksmbd: no need to wait for binded connection termination at logoff +- ksmbd: add support for surrogate pair conversion +- ksmbd: fix missing RDMA-capable flag for IPoIB device in ksmbd_rdma_capable_netdev() +- ksmbd: fix kernel-doc comment of ksmbd_vfs_setxattr() +- ksmbd: reorganize ksmbd_iov_pin_rsp() +- ksmbd: Remove unused field in ksmbd_user struct +- spi: cadence: revert "Add SPI transfer delays" +- x86/smpboot/64: Handle X2APIC BIOS inconsistency gracefully +- x86/alternatives: Disable interrupts and sync when optimizing NOPs in place +- x86/alternatives: Sync core before enabling interrupts +- KVM: arm64: vgic: Force vcpu vgic teardown on vcpu destroy +- KVM: arm64: vgic: Add a non-locking primitive for kvm_vgic_vcpu_destroy() +- KVM: arm64: vgic: Simplify kvm_vgic_destroy() +- thunderbolt: Fix memory leak in margining_port_remove() +- lib/vsprintf: Fix %pfwf when current node refcount == 0 +- gpio: dwapb: mask/unmask IRQ when disable/enale it +- bus: ti-sysc: Flush posted write only after srst_udelay +- pinctrl: starfive: jh7100: ignore disabled device tree nodes +- pinctrl: starfive: jh7110: ignore disabled device tree nodes +- selftests: mptcp: join: fix subflow_send_ack lookup +- dm-integrity: don't modify bio's immutable bio_vec in integrity_metadata() +- tracing / synthetic: Disable events after testing in synth_event_gen_test_init() +- scsi: core: Always send batch on reset or error handling command +- Revert "scsi: aacraid: Reply queue mapping to CPUs based on IRQ affinity" +- nvmem: brcm_nvram: store a copy of NVRAM content +- spi: atmel: Fix clock issue when using devices with different polarities +- spi: atmel: Prevent spi transfers from being killed +- spi: atmel: Do not cancel a transfer upon any signal +- ring-buffer: Fix slowpath of interrupted event +- ring-buffer: Remove useless update to write_stamp in rb_try_to_discard() +- ring-buffer: Fix 32-bit rb_time_read() race with rb_time_cmpxchg() +- 9p: prevent read overrun in protocol dump tracepoint +- drm/i915/dmc: Don't enable any pipe DMC events +- drm/i915: Reject async flips with bigjoiner +- smb: client: fix OOB in smbCalcSize() +- smb: client: fix OOB in SMB2_query_info_init() +- smb: client: fix potential OOB in cifs_dump_detail() +- smb: client: fix OOB in cifsd when receiving compounded resps +- nfsd: call nfsd_last_thread() before final nfsd_put() +- dt-bindings: nvmem: mxs-ocotp: Document fsl,ocotp +- net: stmmac: fix incorrect flag check in timestamp interrupt +- net: avoid build bug in skb extension length calculation +- net: ks8851: Fix TX stall caused by TX buffer overrun +- net: rfkill: gpio: set GPIO direction +- net: 9p: avoid freeing uninit memory in p9pdu_vreadf +- Input: soc_button_array - add mapping for airplane mode button +- net: usb: ax88179_178a: avoid failed operations when device is disconnected +- usb: fotg210-hcd: delete an incorrect bounds test +- usb: typec: ucsi: fix gpio-based orientation detection +- Bluetooth: Add more enc key size check +- Bluetooth: MGMT/SMP: Fix address type when using SMP over BREDR/LE +- Bluetooth: L2CAP: Send reject on command corrupted request +- Bluetooth: af_bluetooth: Fix Use-After-Free in bt_sock_recvmsg +- Bluetooth: hci_event: Fix not checking if HCI_OP_INQUIRY has been sent +- ASoC: tas2781: check the validity of prm_no/cfg_no +- ALSA: hda/realtek: Add quirk for ASUS ROG GV302XA +- ALSA: hda/tas2781: select program 0, conf 0 by default +- USB: serial: option: add Quectel RM500Q R13 firmware support +- USB: serial: option: add Foxconn T99W265 with new baseline +- USB: serial: option: add Quectel EG912Y module support +- USB: serial: ftdi_sio: update Actisense PIDs constant names +- wifi: cfg80211: fix certs build to not depend on file order +- wifi: cfg80211: Add my certificate +- wifi: mt76: fix crash with WED rx support enabled +- usb-storage: Add quirk for incorrect WP on Kingston DT Ultimate 3.0 G3 +- ARM: dts: Fix occasional boot hang for am3 usb +- ALSA: usb-audio: Increase delay in MOTU M quirk +- iio: triggered-buffer: prevent possible freeing of wrong buffer +- iio: tmag5273: fix temperature offset +- iio: adc: ti_am335x_adc: Fix return value check of tiadc_request_dma() +- iio: imu: adis16475: add spi_device_id table +- iio: common: ms_sensors: ms_sensors_i2c: fix humidity conversion time table +- iio: adc: imx93: add four channels for imx93 adc +- iio: kx022a: Fix acceleration value scaling +- scsi: ufs: core: Let the sq_lock protect sq_tail_slot access +- scsi: ufs: qcom: Return ufs_qcom_clk_scale_*() errors in ufs_qcom_clk_scale_notify() +- scsi: bnx2fc: Fix skb double free in bnx2fc_rcv() +- iio: adc: meson: add separate config for axg SoC family +- Input: ipaq-micro-keys - add error handling for devm_kmemdup +- interconnect: qcom: sm8250: Enable sync_state +- iio: imu: inv_mpu6050: fix an error code problem in inv_mpu6050_read_raw +- interconnect: Treat xlate() returning NULL node as an error +- nvme-pci: fix sleeping function called from interrupt context +- gpiolib: cdev: add gpio_device locking wrapper around gpio_ioctl() +- pinctrl: at91-pio4: use dedicated lock class for IRQ +- x86/xen: add CPU dependencies for 32-bit build +- i2c: aspeed: Handle the coalesced stop conditions with the start conditions. +- drm/amdgpu: re-create idle bo's PTE during VM state machine reset +- i2c: qcom-geni: fix missing clk_disable_unprepare() and geni_se_resources_off() +- ASoC: fsl_sai: Fix channel swap issue on i.MX8MP +- ASoC: hdmi-codec: fix missing report for jack initial status +- drm/i915/mtl: Fix HDMI/DP PLL clock selection +- drm/i915/hwmon: Fix static analysis tool reported issues +- afs: Fix use-after-free due to get/remove race in volume tree +- afs: Fix overwriting of result of DNS query +- keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiry +- net: check dev->gso_max_size in gso_features_check() +- net/ipv6: Revert remove expired routes with a separated list of routes +- net: ethernet: mtk_wed: fix possible NULL pointer dereference in mtk_wed_wo_queue_tx_clean() +- afs: Fix dynamic root lookup DNS check +- afs: Fix the dynamic root's d_delete to always delete unused dentries +- net: check vlan filter feature in vlan_vids_add_by_dev() and vlan_vids_del_by_dev() +- net: mana: select PAGE_POOL +- ice: Fix PF with enabled XDP going no-carrier after reset +- ice: alter feature support check for SRIOV and LAG +- ice: stop trashing VF VSI aggregator node ID information +- net: phy: skip LED triggers on PHYs on SFP modules +- bnxt_en: do not map packet buffers twice +- Bluetooth: hci_core: Fix hci_conn_hash_lookup_cis +- Bluetooth: hci_event: shut up a false-positive warning +- Bluetooth: Fix deadlock in vhci_send_frame +- Bluetooth: Fix not notifying when connection encryption changes +- net/rose: fix races in rose_kill_by_device() +- ethernet: atheros: fix a memleak in atl1e_setup_ring_resources +- net: sched: ife: fix potential use-after-free +- net: Return error from sk_stream_wait_connect() if sk_wait_event() fails +- octeontx2-pf: Fix graceful exit during PFC configuration failure +- net: mscc: ocelot: fix pMAC TX RMON stats for bucket 256-511 and above +- net: mscc: ocelot: fix eMAC TX RMON stats for bucket 256-511 and above +- net/mlx5e: Correct snprintf truncation handling for fw_version buffer used by representors +- net/mlx5e: Correct snprintf truncation handling for fw_version buffer +- net/mlx5e: Fix error codes in alloc_branch_attr() +- net/mlx5e: Fix error code in mlx5e_tc_action_miss_mapping_get() +- net/mlx5: Refactor mlx5_flow_destination->rep pointer to vport num +- net/mlx5: Fix fw tracer first block check +- net/mlx5e: XDP, Drop fragmented packets larger than MTU size +- net/mlx5e: Decrease num_block_tc when unblock tc offload +- net/mlx5e: Fix overrun reported by coverity +- net/mlx5e: fix a potential double-free in fs_udp_create_groups +- net/mlx5e: Fix a race in command alloc flow +- net/mlx5e: Fix slab-out-of-bounds in mlx5_query_nic_vport_mac_list() +- Revert "net/mlx5e: fix double free of encap_header" +- Revert "net/mlx5e: fix double free of encap_header in update funcs" +- bpf: syzkaller found null ptr deref in unix_bpf proto add +- ice: fix theoretical out-of-bounds access in ethtool link modes +- wifi: mac80211: mesh_plink: fix matches_local logic +- wifi: mac80211: mesh: check element parsing succeeded +- wifi: mac80211: check defragmentation succeeded +- wifi: mac80211: don't re-add debugfs during reconfig +- wifi: mac80211: check if the existing link config remains unchanged +- wifi: iwlwifi: pcie: add another missing bh-disable for rxq->lock +- wifi: ieee80211: don't require protected vendor action frames +- SUNRPC: Revert 5f7fc5d69f6e92ec0b38774c387f5cf7812c5806 +- platform/x86/intel/pmc: Fix hang in pmc_core_send_ltr_ignore() +- s390/vx: fix save/restore of fpu kernel context +- reset: Fix crash when freeing non-existent optional resets +- ARM: OMAP2+: Fix null pointer dereference and memory leak in omap_soc_device_init +- ARM: dts: dra7: Fix DRA7 L3 NoC node register size +- arm64: dts: allwinner: h616: update emac for Orange Pi Zero 3 +- spi: spi-imx: correctly configure burst length when using dma +- drm: Fix FD ownership check in drm_master_check_perm() +- drm: Update file owner during use +- drm/i915/edp: don't write to DP_LINK_BW_SET when using rate select +- drm/i915: Introduce crtc_state->enhanced_framing +- drm/i915: Fix FEC state dump +- drm/amd/display: fix hw rotated modes when PSR-SU is enabled +- btrfs: free qgroup pertrans reserve on transaction abort +- btrfs: qgroup: use qgroup_iterator in qgroup_convert_meta() +- btrfs: qgroup: iterate qgroups without memory allocation for qgroup_reserve() +- mm/damon/core: make damon_start() waits until kdamond_fn() starts +- mm/damon/core: use number of passed access sampling as a timer +- bpf: Fix prog_array_map_poke_run map poke update +- !5451 arm64: Delete macro in the scsnp feature +- arm64: Delete macro in the scsnp feature +- !5037 [OLK-6.6] Add support for Mucse Network Adapter(N500/N210) +- drivers: initial support for rnpgbe drivers from Mucse Technology +- !4782 [OLK-6.6] Add drivers support for Mucse Network Adapter rnpm (N10/N400) +- drivers: initial support for rnpm drivers from Mucse Technology +- !5340 CVE-2023-52593 +- wifi: wfx: fix possible NULL pointer dereference in wfx_set_mfp_ap() +- !5341 powerpc/lib: Validate size for vector operations +- powerpc/lib: Validate size for vector operations +- !5346 v2 s390/vfio-ap: always filter entire AP matrix +- s390/vfio-ap: always filter entire AP matrix +- !5248 mm: cachestat: fix folio read-after-free in cache walk +- mm: cachestat: fix folio read-after-free in cache walk +- !5212 [OLK-6.6] Support PSPCCP/NTBCCP identification for Hygon 2th and 3th CPU +- crypto: ccp: Add Hygon CSV support +- crypto: ccp: Fixup the capability of Hygon PSP during initialization +- !5318 Backport 6.6.8 LTS Patches +- RDMA/mlx5: Change the key being sent for MPV device affiliation +- x86/speculation, objtool: Use absolute relocations for annotations +- ring-buffer: Have rb_time_cmpxchg() set the msb counter too +- ring-buffer: Do not try to put back write_stamp +- ring-buffer: Fix a race in rb_time_cmpxchg() for 32 bit archs +- ring-buffer: Fix writing to the buffer with max_data_size +- ring-buffer: Have saved event hold the entire event +- ring-buffer: Do not update before stamp when switching sub-buffers +- tracing: Update snapshot buffer on resize if it is allocated +- ring-buffer: Fix memory leak of free page +- smb: client: fix OOB in smb2_query_reparse_point() +- smb: client: fix NULL deref in asn1_ber_decoder() +- smb: client: fix potential OOBs in smb2_parse_contexts() +- drm/i915: Fix remapped stride with CCS on ADL+ +- drm/i915: Fix intel_atomic_setup_scalers() plane_state handling +- drm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original +- drm/amd/display: Disable PSR-SU on Parade 0803 TCON again +- drm/amd/display: Restore guard against default backlight value < 1 nit +- drm/edid: also call add modes in EDID connector update fallback +- drm/amdgpu: fix tear down order in amdgpu_vm_pt_free +- btrfs: don't clear qgroup reserved bit in release_folio +- btrfs: fix qgroup_free_reserved_data int overflow +- btrfs: free qgroup reserve when ORDERED_IOERR is set +- kexec: drop dependency on ARCH_SUPPORTS_KEXEC from CRASH_DUMP +- mm/shmem: fix race in shmem_undo_range w/THP +- mm/mglru: reclaim offlined memcgs harder +- mm/mglru: respect min_ttl_ms with memcgs +- mm/mglru: try to stop at high watermarks +- mm/mglru: fix underprotected page cache +- dmaengine: fsl-edma: fix DMA channel leak in eDMAv4 +- dmaengine: stm32-dma: avoid bitfield overflow assertion +- drm/mediatek: Fix access violation in mtk_drm_crtc_dma_dev_get +- drm/amdgpu/sdma5.2: add begin/end_use ring callbacks +- team: Fix use-after-free when an option instance allocation fails +- arm64: mm: Always make sw-dirty PTEs hw-dirty in pte_modify +- Revert "selftests: error out if kernel header files are not yet built" +- ext4: prevent the normalized size from exceeding EXT_MAX_BLOCKS +- soundwire: stream: fix NULL pointer dereference for multi_link +- cxl/hdm: Fix dpa translation locking +- btrfs: do not allow non subvolume root targets for snapshot +- perf: Fix perf_event_validate_size() lockdep splat +- HID: hid-asus: add const to read-only outgoing usb buffer +- arm64: add dependency between vmlinuz.efi and Image +- smb: client: set correct file type from NFS reparse points +- smb: client: introduce ->parse_reparse_point() +- smb: client: implement ->query_reparse_point() for SMB1 +- net: usb: qmi_wwan: claim interface 4 for ZTE MF290 +- eventfs: Do not allow NULL parent to eventfs_start_creating() +- asm-generic: qspinlock: fix queued_spin_value_unlocked() implementation +- scripts/checkstack.pl: match all stack sizes for s390 +- nfc: virtual_ncidev: Add variable to check if ndev is running +- HID: multitouch: Add quirk for HONOR GLO-GXXX touchpad +- HID: hid-asus: reset the backlight brightness level on resume +- HID: add ALWAYS_POLL quirk for Apple kb +- HID: glorious: fix Glorious Model I HID report +- HID: apple: add Jamesdonkey and A3R to non-apple keyboards list +- HID: mcp2221: Allow IO to start during probe +- HID: mcp2221: Set driver data before I2C adapter add +- platform/x86: intel_telemetry: Fix kernel doc descriptions +- LoongArch: Mark {dmw,tlb}_virt_to_page() exports as non-GPL +- LoongArch: Silence the boot warning about 'nokaslr' +- LoongArch: Record pc instead of offset in la_abs relocation +- LoongArch: Add dependency between vmlinuz.efi and vmlinux.efi +- selftests/bpf: fix bpf_loop_bench for new callback verification scheme +- nvme: catch errors from nvme_configure_metadata() +- nvme-auth: set explanation code for failure2 msgs +- bcache: avoid NULL checking to c->root in run_cache_set() +- bcache: add code comments for bch_btree_node_get() and __bch_btree_node_alloc() +- bcache: remove redundant assignment to variable cur_idx +- bcache: avoid oversize memory allocation by small stripe_size +- blk-throttle: fix lockdep warning of "cgroup_mutex or RCU read lock required!" +- rxrpc: Fix some minor issues with bundle tracing +- stmmac: dwmac-loongson: Add architecture dependency +- usb: aqc111: check packet for fixup for true limit +- x86/hyperv: Fix the detection of E820_TYPE_PRAM in a Gen2 VM +- selftests/mm: cow: print ksft header before printing anything else +- drm/i915: Use internal class when counting engine resets +- drm/i915/selftests: Fix engine reset count storage for multi-tile +- accel/ivpu/37xx: Fix interrupt_clear_with_0 WA initialization +- accel/ivpu: Print information about used workarounds +- drm/mediatek: Add spinlock for setting vblank event in atomic_begin +- drm/mediatek: fix kernel oops if no crtc is found +- PCI: vmd: Fix potential deadlock when enabling ASPM +- ksmbd: fix wrong name of SMB2_CREATE_ALLOCATION_SIZE +- PCI/ASPM: Add pci_enable_link_state_locked() +- PCI: loongson: Limit MRRS to 256 +- Revert "PCI: acpiphp: Reassign resources on bridge if necessary" +- ALSA: hda/tas2781: reset the amp before component_add +- ALSA: hda/tas2781: call cleanup functions only once +- ALSA: hda/tas2781: handle missing EFI calibration data +- ALSA: hda/tas2781: leave hda_component in usable state +- ALSA: hda/realtek: Apply mute LED quirk for HP15-db +- ALSA: hda/hdmi: add force-connect quirks for ASUSTeK Z170 variants +- ALSA: hda/hdmi: add force-connect quirk for NUC5CPYB +- io_uring/cmd: fix breakage in SOCKET_URING_OP_SIOC* implementation +- fuse: dax: set fc->dax to NULL in fuse_dax_conn_free() +- fuse: disable FOPEN_PARALLEL_DIRECT_WRITES with FUSE_DIRECT_IO_ALLOW_MMAP +- fuse: share lookup state between submount and its parent +- fuse: Rename DIRECT_IO_RELAX to DIRECT_IO_ALLOW_MMAP +- HID: Add quirk for Labtec/ODDOR/aikeec handbrake +- HID: i2c-hid: Add IDEA5002 to i2c_hid_acpi_blacklist[] +- net: atlantic: fix double free in ring reinit logic +- appletalk: Fix Use-After-Free in atalk_ioctl +- net: stmmac: Handle disabled MDIO busses from devicetree +- net: stmmac: dwmac-qcom-ethqos: Fix drops in 10M SGMII RX +- dpaa2-switch: do not ask for MDB, VLAN and FDB replay +- dpaa2-switch: fix size of the dma_unmap +- vsock/virtio: Fix unsigned integer wrap around in virtio_transport_has_space() +- sign-file: Fix incorrect return values check +- stmmac: dwmac-loongson: Make sure MDIO is initialized before use +- net: ena: Fix XDP redirection error +- net: ena: Fix DMA syncing in XDP path when SWIOTLB is on +- net: ena: Fix xdp drops handling due to multibuf packets +- net: ena: Destroy correct number of xdp queues upon failure +- net: Remove acked SYN flag from packet in the transmit queue correctly +- qed: Fix a potential use-after-free in qed_cxt_tables_alloc +- iavf: Fix iavf_shutdown to call iavf_remove instead iavf_close +- iavf: Handle ntuple on/off based on new state machines for flow director +- iavf: Introduce new state machines for flow director +- net/rose: Fix Use-After-Free in rose_ioctl +- atm: Fix Use-After-Free in do_vcc_ioctl +- octeontx2-af: Fix pause frame configuration +- octeontx2-af: Update RSS algorithm index +- octeontx2-pf: Fix promisc mcam entry action +- octeon_ep: explicitly test for firmware ready value +- net/sched: act_ct: Take per-cb reference to tcf_ct_flow_table +- octeontx2-af: fix a use-after-free in rvu_nix_register_reporters +- net: fec: correct queue selection +- atm: solos-pci: Fix potential deadlock on &tx_queue_lock +- atm: solos-pci: Fix potential deadlock on &cli_queue_lock +- bnxt_en: Fix HWTSTAMP_FILTER_ALL packet timestamp logic +- bnxt_en: Fix wrong return value check in bnxt_close_nic() +- bnxt_en: Fix skb recycling logic in bnxt_deliver_skb() +- bnxt_en: Clear resource reservation during resume +- qca_spi: Fix reset behavior +- qca_debug: Fix ethtool -G iface tx behavior +- qca_debug: Prevent crash on TX ring changes +- net: ipv6: support reporting otherwise unknown prefix flags in RTM_NEWPREFIX +- net/mlx5: Fix a NULL vs IS_ERR() check +- net/mlx5e: Check netdev pointer before checking its net ns +- net/mlx5: Nack sync reset request when HotPlug is enabled +- net/mlx5e: TC, Don't offload post action rule if not supported +- net/mlx5e: Fix possible deadlock on mlx5e_tx_timeout_work +- net/mlx5e: Disable IPsec offload support if not FW steering +- RDMA/mlx5: Send events from IB driver about device affiliation state +- net/mlx5e: Check the number of elements before walk TC rhashtable +- net/mlx5e: Reduce eswitch mode_lock protection context +- net/mlx5e: Tidy up IPsec NAT-T SA discovery +- net/mlx5e: Unify esw and normal IPsec status table creation/destruction +- net/mlx5e: Ensure that IPsec sequence packet number starts from 1 +- net/mlx5e: Honor user choice of IPsec replay window size +- HID: lenovo: Restrict detection of patched firmware only to USB cptkbd +- afs: Fix refcount underflow from error handling race +- efi/x86: Avoid physical KASLR on older Dell systems +- ksmbd: fix memory leak in smb2_lock() +- ext4: fix warning in ext4_dio_write_end_io() +- r8152: add vendor/device ID pair for ASUS USB-C2500 +- !5239 crypto: hisilicon support no-sva feature +- crypto: hisilicon/qm - register to UACCE subsystem in UACCE_MODE_NOIOMMU mode +- crypto: hisilicon/qm - get the type of iommu +- uacce: support UACCE_MODE_NOIOMMU mode +- !5256 net: hns3: some bugfix for the HNS3 ethernet driver +- net: hns3: add checking for vf id of mailbox +- net: hns3: fix port duplex configure error in IMP reset +- net: hns3: fix reset timeout under full functions and queues +- net: hns3: fix delete tc fail issue +- net: hns3: fix kernel crash when 1588 is received on HIP08 devices +- net: hns3: Disable SerDes serial loopback for HiLink H60 +- net: hns3: add new 200G link modes for hisilicon device +- net: hns3: fix wrong judgment condition issue +- !5250 f2fs: fix to tag gcing flag on page during block migration +- f2fs: fix to tag gcing flag on page during block migration +- !5249 btrfs: scrub: avoid use-after-free when chunk length is not 64K aligned +- btrfs: scrub: avoid use-after-free when chunk length is not 64K aligned +- !5244 ceph: fix deadlock or deadcode of misusing dget() +- ceph: fix deadlock or deadcode of misusing dget() +- !5180 RDMA/hns: Support hns RoCE Bonding +- RDMA/hns: Fix the concurrency error between bond and reset. +- RDMA/hns: Fix the device loss after unbinding RoCE bond resource slave +- RDMA/hns: Fix wild pointer error of RoCE bonding when rmmod hns3 +- RDMA/hns: Support reset recovery for RoCE bonding +- RDMA/hns: Add functions to obtain netdev and bus_num from an hr_dev +- RDMA/hns: Support dispatching IB event for RoCE bonding +- RDMA/hns: Set IB port state depending on upper device for RoCE bonding +- RDMA/hns: Support RoCE bonding + +* Thu Mar 14 2024 Zheng Zengkai - 6.6.0-12.0.0.8 +- !5174 [OLK-6.6][sync from OLK-5.10] Introduce multiple LPI translation caches +- KVM:arm64:vgic update openEuler's config's to enable MULTI_LPI_TRANSLATE_CACHE +- KVM: arm64: vgic-its: Do not execute invalidate MSI-LPI translation cache on movi command +- KVM: arm64: vgic-its: Introduce multiple LPI translation caches +- !5208 Revert “Fix the header file location error and adjust the function and structure version.” +- Revert “Fix the header file location error and adjust the function and structure version.” +- !5199 v2 mTHP anon support +- uprobes: use pagesize-aligned virtual address when replacing pages +- selftests/mm/cow: add tests for anonymous multi-size THP +- selftests/mm/cow: generalize do_run_with_thp() helper +- selftests/mm/khugepaged: enlighten for multi-size THP +- selftests/mm: support multi-size THP interface in thp_settings +- selftests/mm: factor out thp settings management +- selftests/mm/kugepaged: restore thp settings at exit +- mm: thp: support allocation of anonymous multi-size THP +- mm: thp: introduce multi-size THP sysfs interface +- mm: non-pmd-mappable, large folios for folio_add_new_anon_rmap() +- mm: allow deferred splitting of arbitrary anon large folios +- mm/readahead: do not allow order-1 folio +- mm: more ptep_get() conversion +- mm/thp: fix "mm: thp: kill __transhuge_page_enabled()" +- memory: move exclusivity detection in do_wp_page() into wp_can_reuse_anon_folio() +- mm/rmap: convert page_move_anon_rmap() to folio_move_anon_rmap() +- mm/rmap: move SetPageAnonExclusive() out of page_move_anon_rmap() +- mm/rmap: pass folio to hugepage_add_anon_rmap() +- mm/rmap: simplify PageAnonExclusive sanity checks when adding anon rmap +- mm/rmap: warn on new PTE-mapped folios in page_add_anon_rmap() +- mm/rmap: move folio_test_anon() check out of __folio_set_anon() +- mm/rmap: move SetPageAnonExclusive out of __page_set_anon_rmap() +- mm/rmap: drop stale comment in page_add_anon_rmap and hugepage_add_anon_rmap() +- !4908 cgroup/cpuset: add exclusive and exclusive.effective for v2 +- cgroup/cpuset: Fix retval in update_cpumask() +- cgroup/cpuset: Fix a memory leak in update_exclusive_cpumask() +- cgroup/cpuset: Cleanup signedness issue in cpu_exclusive_check() +- cgroup/cpuset: Enable invalid to valid local partition transition +- cgroup/cpuset: Check partition conflict with housekeeping setup +- cgroup/cpuset: Introduce remote partition +- cgroup/cpuset: Add cpuset.cpus.exclusive for v2 +- cgroup/cpuset: Add cpuset.cpus.exclusive.effective for v2 +- !5159 【OLK-6.6】iommu: reserve KABI for struct iommu_ops +- [OLK-6.6] iommu:kabi reserver space for struct iommu_ops +- !5149 net: hns3: add support some customized exception handling interfaces +- net: hns3: add input parameters checking +- net: hns3: add extend interface support for read and write phy register +- net: hns3: add support set led +- net: hns3: add support set mac state +- net: hns3: add support detect port wire type +- net: hns3: add support PF provides customized interfaces to detect port faults. +- net: hns3: support set pfc pause trans time +- net: hns3: add support disable nic clock +- net: hns3: add support config and query serdes lane status +- net: hns3: add supports configure optical module enable +- net: hns3: add support query the presence of optical module +- net: hns3: add support modified tx timeout +- net: hns3: add support query port ext information +- net: hns3: add support configuring function-level interrupt affinity +- net: hns3: add support clear mac statistics +- net: hns3: add support to get/set 1d torus param +- net: hns3: add supports fast reporting of faulty nodes +- net: hns3: add supports pfc storm detection and suppression +- net: hns3: add support customized exception handling interfaces +- !4761 [OLK-6.6] backport 6.7 kernel signal patch +- riscv: signal: handle syscall restart before get_signal +- !5151 intel-sig: configs: enable TPMI related configs for OLK6.6 +- config: update Intel TPMI based driver configs to openeuler_defconfig for x86 +- !5150 intel-sig: configs: enable PMT related configs for OLK6.6 +- config: x86: Intel: enabled PMT SDSI TPMI configs +- !4427 【OLK-6.6】watchdog: Support watchdog_sdei coexist with existing watchdogs +- watchdog: Support watchdog_sdei coexist with existing watchdogs +- !4776 [OLK-6.6] kabi:reserve space for msi expansion +- [OLK-6.6] kabi:reserve space for msi expansion +- !5041 [OLK-6.6] support the AMD Zen5 Turin +- x86/CPU/AMD: Add more models to X86_FEATURE_ZEN5 +- x86/CPU/AMD: Add X86_FEATURE_ZEN5 +- x86/CPU/AMD: Add X86_FEATURE_ZEN1 +- x86/CPU/AMD: Drop now unused CPU erratum checking function +- x86/CPU/AMD: Get rid of amd_erratum_1485[] +- x86/CPU/AMD: Get rid of amd_erratum_400[] +- x86/CPU/AMD: Get rid of amd_erratum_383[] +- x86/CPU/AMD: Get rid of amd_erratum_1054[] +- x86/CPU/AMD: Move the DIV0 bug detection to the Zen1 init function +- x86/CPU/AMD: Move Zenbleed check to the Zen2 init function +- x86/CPU/AMD: Rename init_amd_zn() to init_amd_zen_common() +- x86/CPU/AMD: Call the spectral chicken in the Zen2 init function +- x86/CPU/AMD: Move erratum 1076 fix into the Zen1 init function +- x86/CPU/AMD: Move the Zen3 BTC_NO detection to the Zen3 init function +- x86/CPU/AMD: Carve out the erratum 1386 fix +- x86/CPU/AMD: Add ZenX generations flags +- !5036 [OLK-6.6] Do not serialize MSR accesses on AMD +- x86/barrier: Do not serialize MSR accesses on AMD +- !5134 modpost: Optimize symbol search from linear to binary search +- modpost: Optimize symbol search from linear to binary search +- !4826 add sw64 architecture support +- drivers: vfio: add sw64 support +- drivers: usb: add sw64 support +- drivers: tty: add sw64 support +- drivers: spi: add sw64 support +- drivers: scsi: add sw64 support +- drivers: rtc: add sw64 rtc support +- drivers: qemu_fw_cfg: add sw64 support +- drivers: platform: add sw64 support +- drivers: pci: add sw64 support +- drivers: misc: add sw64 support +- drivers: mfd: add sw64 support +- drivers: irqchip: add sw64 support +- drivers: iommu: add sw64 support +- drivers: i2c: add sw64 support +- drivers: hwmon: add sw64 support +- drivers: gpio: add sw64 support +- drivers: efi: add sw64 support +- !4927 ima: digest list new support modsig +- ima: digest list new support modsig +- !4971 net: hns3: backport some patch from kernel 6.7 +- net: hns3: add some link modes for hisilicon device +- net: hns3: add vf fault detect support +- net: hns3: add hns3 vf fault detect cap bit support +- !5040 [OLK-6.6] Add support for Vendor Defined Error Types in Einj Module +- ACPI: APEI: EINJ: Add support for vendor defined error types +- platform/chrome: cros_ec_debugfs: Fix permissions for panicinfo +- fs: debugfs: Add write functionality to debugfs blobs +- ACPI: APEI: EINJ: Refactor available_error_type_show() +- !5039 [OLK-6.6] Fix disabling memory if DVSEC CXL Range does not match a CFMWS window +- cxl/pci: Fix disabling memory if DVSEC CXL Range does not match a CFMWS window +- !5047 Backport etmem swapcache recalim feature to OLK 6.6 +- etmem: add swapcache reclaim to etmem +- etmem: Expose symbol reclaim_folio_list +- !4514 [OLK-6.6] kabi: IOMMU subsystem reservation +- kabi: IOMMU reservations +- kabi: bus_type, device_driver, dev_pm_ops reservation +- !5056 erofs: fix handling kern_mount() failure +- erofs: fix handling kern_mount() failure +- !5059 dm: limit the number of targets and parameter size area +- dm: limit the number of targets and parameter size area +- !5021 LoongArch: fix some known issue and update defconfig +- LoongArch: enable CONFIG_DEBUG_INFO_BTF by default +- net: stmmac: fix potential double free of dma descriptor resources +- drm/radeon: Workaround radeon driver bug for Loongson +- irqchip/loongson-liointc: Set different isr for differnt core +- LoongArch: kdump: Add high memory reservation +- LoongArch: Fix kdump failure on v40 interface specification +- LoongArch: kexec: Add compatibility with old interfaces +- LoongArch: kdump: Add memory reservation for old kernel +- LoongArch: defconfig: Enable a large number of configurations +- irqchip/loongson-pch-pic: 7a1000 int_clear reg must use 64bit write. +- LoongArch: Remove generic irq migration +- LoongArch: Adapted SECTION_SIZE_BITS with page size +- !4689 Remove WQ_FLAG_BOOKMARK flag +- sched: remove wait bookmarks +- filemap: remove use of wait bookmarks +- !5024 v2 vmemmap optimize bugfix +- mm: hugetlb_vmemmap: allow alloc vmemmap pages fallback to other nodes +- mm: hugetlb_vmemmap: fix hugetlb page number decrease failed on movable nodes +- !4653 [OLK-6.6] Add support for Mucse Network Adapter(N10/N400) +- drivers: initial support for rnp drivers from Mucse Technology +- !4935 RDMA/hns: Support userspace configuring congestion control algorithm with QP granularity +- RDMA/hns: Support userspace configuring congestion control algorithm with QP granularity +- RDMA/hns: Fix mis-modifying default congestion control algorithm +- !4993 v3 kworker: Fix the problem of ipsan performance degradation +- Add kernel compilation configuration options +- iscsi: use dynamic single thread workqueue to improve performance +- workqueue: add member for NUMA aware order workqueue and implement NUMA affinity for single thread workqueue +- !4930 erofs: fix lz4 inplace decompression +- erofs: fix lz4 inplace decompression +- !4082 【OLK-6.6】KVM: arm64: vtimer irq bypass support +- mbigen: probe mbigen driver with arch_initcall +- mbigen: vtimer: disable vtimer mbigen probe when vtimer_irqbypass disabled +- mbigen: Sets the regs related to vtimer irqbypass +- KVM: arm64: vgic-v3: Clearing pending status of vtimer on guest reset +- mbigen: vtimer: add support for MBIX1_CPPI_NEGEDGE_CLR_EN_SETR(CLRR) +- KVM: arm64: arch_timer: Make vtimer_irqbypass a Distributor attr +- KVM: arm64: vtimer: Expose HW-based vtimer interrupt in debugfs +- KVM: arm64: GICv4.1: Allow non-trapping WFI when using direct vtimer interrupt +- KVM: arm64: GICv4.1: Add support for MBIGEN save/restore +- KVM: arm64: arch_timer: Rework vcpu init/reset logic +- KVM: arm64: arch_timer: Probe vtimer irqbypass capability +- KVM: arm64: GICv4.1: Enable vtimer vPPI irqbypass config +- KVM: arm64: GICv4.1: Add direct injection capability to PPI registers +- KVM: arm64: vgic: Add helper for vtimer vppi info register +- KVM: arm64: GICv4.1: Inform the HiSilicon vtimer irqbypass capability +- irqchip/gic-v4.1: Probe vtimer irqbypass capability at RD level +- irqchip/gic-v4.1: Rework its_alloc_vcpu_sgis() to support vPPI allocation +- irqchip/gic-v4.1: Rework get/set_irqchip_state callbacks of GICv4.1-sgi chip +- irqchip/gic-v4.1: Extend VSGI command to support the new vPPI +- irqchip/gic-v4.1: Detect ITS vtimer interrupt bypass capability +- mbigen: vtimer mbigen driver support +- mbigen: vtimer: isolate mbigen vtimer funcs with macro +- !4875 [OLK-6.6] backport latest v6.8 iommu fixes +- iommufd/selftest: Don't check map/unmap pairing with HUGE_PAGES +- iommufd: Fix protection fault in iommufd_test_syz_conv_iova +- iommufd/selftest: Fix mock_dev_num bug +- iommufd: Fix iopt_access_list_id overwrite bug +- iommu/sva: Fix SVA handle sharing in multi device case +- !4867 ext4: regenerate buddy after block freeing failed if under fc replay +- ext4: regenerate buddy after block freeing failed if under fc replay +- !4851 cachefiles: fix memory leak in cachefiles_add_cache() +- cachefiles: fix memory leak in cachefiles_add_cache() +- !4913 RDMA/hns: Support SCC parameter configuration and reporting of the down/up event of the HNS RoCE network port +- RDMA/hns: Add support for sending port down event fastly +- RDMA/hns: Deliver net device event to ofed +- RDMA/hns: Support congestion control algorithm parameter configuration +- !4670 crypto HiSilicon round main line code +- crypto: hisilicon/qm - change function type to void +- crypto: hisilicon/qm - obtain stop queue status +- crypto: hisilicon/qm - add stop function by hardware +- crypto: hisilicon/sec - remove unused parameter +- crypto: hisilicon/sec2 - fix some cleanup issues +- crypto: hisilicon/sec2 - modify nested macro call +- crypto: hisilicon/sec2 - updates the sec DFX function register +- crypto: hisilicon - Fix smp_processor_id() warnings +- crypto: hisilicon/qm - dump important registers values before resetting +- crypto: hisilicon/qm - support get device state +- crypto: hisilicon/sec2 - optimize the error return process +- crypto: hisilicon/qm - delete a dbg function +- crypto: hisilicon/sec2 - Remove cfb and ofb +- crypto: hisilicon/zip - save capability registers in probe process +- crypto: hisilicon/sec2 - save capability registers in probe process +- crypto: hisilicon/hpre - save capability registers in probe process +- crypto: hisilicon/qm - save capability registers in qm init process +- crypto: hisilicon/qm - add a function to set qm algs +- crypto: hisilicon/qm - add comments and remove redundant array element +- crypto: hisilicon/qm - simplify the status of qm +- crypto: hisilicon/sgl - small cleanups for sgl.c +- crypto: hisilicon/zip - add zip comp high perf mode configuration +- crypto: hisilicon/qm - remove incorrect type cast +- crypto: hisilicon/qm - print device abnormal information +- crypto: hisilicon/trng - Convert to platform remove callback returning void +- crypto: hisilicon/sec - Convert to platform remove callback returning void +- crypto: hisilicon/qm - fix EQ/AEQ interrupt issue +- crypto: hisilicon/qm - alloc buffer to set and get xqc +- crypto: hisilicon/qm - check function qp num before alg register +- crypto: hisilicon/qm - fix the type value of aeq +- crypto: hisilicon/sec - fix for sgl unmmap problem +- crypto: hisilicon/zip - remove zlib and gzip +- crypto: hisilicon/zip - support deflate algorithm +- uacce: make uacce_class constant +- !4725 [OLK-6.6] merge upstream net-v6.7 all wangxun patches +- net: fill in MODULE_DESCRIPTION()s for wx_lib +- wangxun: select CONFIG_PHYLINK where needed +- net: wangxun: add ethtool_ops for msglevel +- net: wangxun: add coalesce options support +- net: wangxun: add ethtool_ops for ring parameters +- net: wangxun: add flow control support +- net: ngbe: convert phylib to phylink +- net: txgbe: use phylink bits added in libwx +- net: libwx: add phylink to libwx +- net: wangxun: remove redundant kernel log +- net: ngbe: add ethtool stats support +- net: txgbe: add ethtool stats support +- net: wangxun: move MDIO bus implementation to the library +- net: libwx: fix memory leak on free page +- net: libwx: support hardware statistics +- net: wangxun: fix changing mac failed when running +- !4841 Intel-sig: intel_idle: add Sierra Forest SoC support on 6.6 +- intel_idle: add Sierra Forest SoC support +- !4834 ras: fix return type of log_arm_hw_error when not add CONFIG_RAS_ARM_EVENT_INFO config +- ras: fix return type of log_arm_hw_error when not add CONFIG_RAS_ARM_EVENT_INFO config +- !4845 PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource() +- PCI: Avoid potential out-of-bounds read in pci_dev_for_each_resource() +- !4773 Add loongarch kernel kvm support +- loongarch/kernel: Fix loongarch compilation error +- LoongArch: KVM: Add returns to SIMD stubs +- LoongArch: KVM: Streamline kvm_check_cpucfg() and improve comments +- LoongArch: KVM: Rename _kvm_get_cpucfg() to _kvm_get_cpucfg_mask() +- LoongArch: KVM: Fix input validation of _kvm_get_cpucfg() & kvm_check_cpucfg() +- irqchip/loongson-eiointc: Use correct struct type in eiointc_domain_alloc() +- LoongArch: KVM: Add LASX (256bit SIMD) support +- LoongArch: KVM: Add LSX (128bit SIMD) support +- LoongArch: KVM: Fix timer emulation with oneshot mode +- LoongArch: KVM: Remove kvm_acquire_timer() before entering guest +- LoongArch: KVM: Allow to access HW timer CSR registers always +- LoongArch: KVM: Remove SW timer switch when vcpu is halt polling +- LoongArch: KVM: Optimization for memslot hugepage checking +- LoongArch: Implement constant timer shutdown interface +- LoongArch: KVM: Add maintainers for LoongArch KVM +- LoongArch: KVM: Supplement kvm document about LoongArch-specific part +- LoongArch: KVM: Enable kvm config and add the makefile +- LoongArch: KVM: Implement vcpu world switch +- LoongArch: KVM: Implement kvm exception vectors +- LoongArch: KVM: Implement handle fpu exception +- LoongArch: KVM: Implement handle mmio exception +- LoongArch: KVM: Implement handle gspr exception +- LoongArch: KVM: Implement handle idle exception +- LoongArch: KVM: Implement handle iocsr exception +- LoongArch: KVM: Implement handle csr exception +- LoongArch: KVM: Implement kvm mmu operations +- LoongArch: KVM: Implement virtual machine tlb operations +- LoongArch: KVM: Implement vcpu timer operations +- LoongArch: KVM: Implement misc vcpu related interfaces +- LoongArch: KVM: Implement vcpu load and vcpu put operations +- LoongArch: KVM: Implement vcpu interrupt operations +- LoongArch: KVM: Implement fpu operations for vcpu +- LoongArch: KVM: Implement basic vcpu ioctl interfaces +- LoongArch: KVM: Implement basic vcpu interfaces +- LoongArch: KVM: Add vcpu related header files +- LoongArch: KVM: Implement VM related functions +- LoongArch: KVM: Implement kvm hardware enable, disable interface +- LoongArch: KVM: Implement kvm module related interface +- LoongArch: KVM: Add kvm related header files +- !3951 【OLK-6.6】KVM/arm64: support virt_dev irqbypass +- KVM: arm64: update arm64 openeuler_defconfig for CONFIG_VIRT_PLAT_DEV +- KVM: arm64: sdev: Support virq bypass by INT/VSYNC command +- KVM: arm64: kire: irq routing entry cached the relevant cache data +- KVM: arm64: Introduce shadow device +- virt_plat_dev: Register the virt platform device driver +- irqchip/gic-v3-its: Add virt platform devices MSI support +- irqchip/gic-v3-its: Alloc/Free device id from pools for virtual devices +- irqchip/gic-v3-its: Introduce the reserved device ID pools +- !4425 【OLK-6.6】arm64/nmi: Support for FEAT_NMI +- irqchip/gic-v3: Fix hard LOCKUP caused by NMI being masked +- config: enable CONFIG_ARM64_NMI and CONFIG_HARDLOCKUP_DETECTOR_PERF for arm64 +- irqchip/gic-v3: Implement FEAT_GICv3_NMI support +- arm64/nmi: Add Kconfig for NMI +- arm64/nmi: Add handling of superpriority interrupts as NMIs +- arm64/irq: Document handling of FEAT_NMI in irqflags.h +- arm64/entry: Don't call preempt_schedule_irq() with NMIs masked +- arm64/nmi: Manage masking for superpriority interrupts along with DAIF +- KVM: arm64: Hide FEAT_NMI from guests +- arm64/cpufeature: Detect PE support for FEAT_NMI +- arm64/idreg: Add an override for FEAT_NMI +- arm64/hyp-stub: Enable access to ALLINT +- arm64/asm: Introduce assembly macros for managing ALLINT +- arm64/sysreg: Add definitions for immediate versions of MSR ALLINT +- arm64/booting: Document boot requirements for FEAT_NMI +- !4679 f2fs: fix to avoid dirent corruption +- f2fs: fix to avoid dirent corruption +- !4730 coresight: trbe: Enable ACPI based devices +- coresight: trbe: Enable ACPI based TRBE devices +- coresight: trbe: Add a representative coresight_platform_data for TRBE +- !4807 [OLK-6.6] Intel: backport KVM LAM from v6.8 to OLK-6.6 +- KVM: x86: Use KVM-governed feature framework to track "LAM enabled" +- KVM: x86: Advertise and enable LAM (user and supervisor) +- KVM: x86: Virtualize LAM for user pointer +- KVM: x86: Virtualize LAM for supervisor pointer +- KVM: x86: Untag addresses for LAM emulation where applicable +- KVM: x86: Introduce get_untagged_addr() in kvm_x86_ops and call it in emulator +- KVM: x86: Remove kvm_vcpu_is_illegal_gpa() +- KVM: x86: Add & use kvm_vcpu_is_legal_cr3() to check CR3's legality +- KVM: x86/mmu: Drop non-PA bits when getting GFN for guest's PGD +- KVM: x86: Add X86EMUL_F_INVLPG and pass it in em_invlpg() +- KVM: x86: Add an emulation flag for implicit system access +- KVM: x86: Consolidate flags for __linearize() +- !4700 efivarfs: force RO when remounting if SetVariable is not supported +- efivarfs: force RO when remounting if SetVariable is not supported +- !4785 Support PV-sched feature +- KVM: arm64: Support the vCPU preemption check +- KVM: arm64: Add interface to support vCPU preempted check +- KVM: arm64: Support pvsched preempted via shared structure +- KVM: arm64: Implement PV_SCHED_FEATURES call +- KVM: arm64: Document PV-sched interface +- !4629 add sw64 architecture support +- drivers: cpufreq: add sw64 support +- drivers: clocksource: add sw64 support +- drivers: acpi: add sw64 support +- selftests: fix sw64 support +- perf: fix sw64 support +- perf: add sw64 support +- tools: fix basic sw64 support +- tools: add basic sw64 support +- sw64: fix ftrace support +- sw64: fix audit support +- sw64: fix kexec support +- sw64: fix PCI support +- sw64: fix KVM support +- sw64: fix module support +- sw64: fix ACPI support +- sw64: fix rrk support +- sw64: fix ELF support +- !4727 RAS: Report ARM processor information to userspace +- RAS: Report ARM processor information to userspace +- !4769 [sync] PR-4729: serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed +- serial: 8250: omap: Don't skip resource freeing if pm_runtime_resume_and_get() failed +- !4781 x86/fpu: Stop relying on userspace for info to fault in xsave buffer +- x86/fpu: Stop relying on userspace for info to fault in xsave buffer +- !4787 v2 gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump +- gfs2: Fix kernel NULL pointer dereference in gfs2_rgrp_dump +- !4789 v2 fix CVE-2024-26590 +- erofs: fix inconsistent per-file compression format +- erofs: simplify compression configuration parser +- !4736 PCIe and miniIO OLK-5.10 branch partial code round OLK-6.6 branch +- xhci:fix USB xhci controller issue +- spi: hisi-sfc-v3xx: return IRQ_NONE if no interrupts were detected +- Add the verification operation after the bus recovery operation obtains resources through the ACPI +- i2c: hisi: Add gpio bus recovery support +- gpio: hisi: Fix format specifier +- perf hisi-ptt: Fix one memory leakage in hisi_ptt_process_auxtrace_event() +- Fix the header file location error and adjust the function and structure version. +- hwtracing: hisi_ptt: Don't try to attach a task +- hwtracing: hisi_ptt: Optimize the trace data committing +- hwtracing: hisi_ptt: Handle the interrupt in hardirq context +- hwtracing: hisi_ptt: Disable interrupt after trace end +- !4802 Export vcpu stat via debugfs +- kvm: debugfs: add EXIT_REASON_PREEMPTION_TIMER to vcpu_stat +- kvm: debugfs: add fastpath msr_wr exits to debugfs statistics +- kvm: debugfs: Export x86 kvm exits to vcpu_stat +- kvm: debugfs: aarch64 export cpu time related items to debugfs +- kvm: debugfs: export remaining aarch64 kvm exit reasons to debugfs +- kvm: debugfs: Export vcpu stat via debugfs +- !4676 [OLK-6.6] kabi/iommu: Backport patches from upstream and maintainer tree +- iommu/sva: Restore SVA handle sharing +- iommu/arm-smmu-v3: Do not use GFP_KERNEL under as spinlock +- Revert "iommu/arm-smmu: Convert to domain_alloc_paging()" +- iommu/vt-d: Fix constant-out-of-range warning +- iommu/vt-d: Set SSADE when attaching to a parent with dirty tracking +- iommu/vt-d: Add missing dirty tracking set for parent domain +- iommu/vt-d: Wrap the dirty tracking loop to be a helper +- iommu/vt-d: Remove domain parameter for intel_pasid_setup_dirty_tracking() +- iommu/vt-d: Add missing device iotlb flush for parent domain +- iommu/vt-d: Update iotlb in nested domain attach +- iommu/vt-d: Add missing iotlb flush for parent domain +- iommu/vt-d: Add __iommu_flush_iotlb_psi() +- iommu/vt-d: Track nested domains in parent +- iommu: Make iommu_report_device_fault() return void +- iommu: Make iopf_group_response() return void +- iommu: Track iopf group instead of last fault +- iommu: Improve iopf_queue_remove_device() +- iommu: Use refcount for fault data access +- iommu: Refine locking for per-device fault data management +- iommu: Separate SVA and IOPF +- iommu: Make iommu_queue_iopf() more generic +- iommu: Prepare for separating SVA and IOPF +- iommu: Merge iommu_fault_event and iopf_fault +- iommu: Remove iommu_[un]register_device_fault_handler() +- iommu: Merge iopf_device_param into iommu_fault_param +- iommu: Cleanup iopf data structure definitions +- iommu: Remove unrecoverable fault data +- iommu/arm-smmu-v3: Remove unrecoverable faults reporting +- iommu: Move iommu fault data to linux/iommu.h +- iommu/iova: use named kmem_cache for iova magazines +- iommu/iova: Reorganise some code +- iommu/iova: Tidy up iova_cache_get() failure +- selftests/iommu: fix the config fragment +- iommufd: Reject non-zero data_type if no data_len is provided +- iommufd/iova_bitmap: Consider page offset for the pages to be pinned +- iommufd/selftest: Add mock IO hugepages tests +- iommufd/selftest: Hugepage mock domain support +- iommufd/selftest: Refactor mock_domain_read_and_clear_dirty() +- iommufd/selftest: Refactor dirty bitmap tests +- iommufd/iova_bitmap: Handle recording beyond the mapped pages +- iommufd/selftest: Test u64 unaligned bitmaps +- iommufd/iova_bitmap: Switch iova_bitmap::bitmap to an u8 array +- iommufd/iova_bitmap: Bounds check mapped::pages access +- powerpc/iommu: Fix the missing iommu_group_put() during platform domain attach +- powerpc: iommu: Bring back table group release_ownership() call +- iommu: Allow ops->default_domain to work when !CONFIG_IOMMU_DMA +- iommufd/selftest: Check the bus type during probe +- iommu/vt-d: Add iotlb flush for nested domain +- iommufd: Add data structure for Intel VT-d stage-1 cache invalidation +- iommufd/selftest: Add coverage for IOMMU_HWPT_INVALIDATE ioctl +- iommufd/selftest: Add IOMMU_TEST_OP_MD_CHECK_IOTLB test op +- iommufd/selftest: Add mock_domain_cache_invalidate_user support +- iommu: Add iommu_copy_struct_from_user_array helper +- iommufd: Add IOMMU_HWPT_INVALIDATE +- iommu: Add cache_invalidate_user op +- iommu: Don't reserve 0-length IOVA region +- iommu/sva: Fix memory leak in iommu_sva_bind_device() +- iommu/dma: Trace bounce buffer usage when mapping buffers +- iommu/tegra: Use tegra_dev_iommu_get_stream_id() in the remaining places +- acpi: Do not return struct iommu_ops from acpi_iommu_configure_id() +- iommu: Mark dev_iommu_priv_set() with a lockdep +- iommu: Mark dev_iommu_get() with lockdep +- iommu/of: Use -ENODEV consistently in of_iommu_configure() +- iommmu/of: Do not return struct iommu_ops from of_iommu_configure() +- iommu: Remove struct iommu_ops *iommu from arch_setup_dma_ops() +- iommu: Set owner token to SVA domain +- mm: Deprecate pasid field +- iommu: Support mm PASID 1:n with sva domains +- mm: Add structure to keep sva information +- iommu: Add mm_get_enqcmd_pasid() helper function +- iommu/vt-d: Remove mm->pasid in intel_sva_bind_mm() +- iommu: Change kconfig around IOMMU_SVA +- iommu: Extend LPAE page table format to support custom allocators +- iommu: Allow passing custom allocators to pgtable drivers +- iommu: Clean up open-coded ownership checks +- iommu: Retire bus ops +- iommu/arm-smmu: Don't register fwnode for legacy binding +- iommu: Decouple iommu_domain_alloc() from bus ops +- iommu: Validate that devices match domains +- iommu: Decouple iommu_present() from bus ops +- iommu: Factor out some helpers +- iommu: Map reserved memory as cacheable if device is coherent +- iommu/vt-d: Move inline helpers to header files +- iommu/vt-d: Remove unused vcmd interfaces +- iommu/vt-d: Remove unused parameter of intel_pasid_setup_pass_through() +- iommu/vt-d: Refactor device_to_iommu() to retrieve iommu directly +- iommu/virtio: Add ops->flush_iotlb_all and enable deferred flush +- iommu/virtio: Make use of ops->iotlb_sync_map +- iommu/arm-smmu: Convert to domain_alloc_paging() +- iommu/arm-smmu: Pass arm_smmu_domain to internal functions +- iommu/arm-smmu: Implement IOMMU_DOMAIN_BLOCKED +- iommu/arm-smmu: Convert to a global static identity domain +- iommu/arm-smmu: Reorganize arm_smmu_domain_add_master() +- iommu/arm-smmu-v3: Remove ARM_SMMU_DOMAIN_NESTED +- iommu/arm-smmu-v3: Master cannot be NULL in arm_smmu_write_strtab_ent() +- iommu/arm-smmu-v3: Add a type for the STE +- iommu/apple-dart: Fix spelling mistake "grups" -> "groups" +- iommu/apple-dart: Use readl instead of readl_relaxed for consistency +- iommu/apple-dart: Add support for t8103 USB4 DART +- iommu/apple-dart: Write to all DART_T8020_STREAM_SELECT +- dt-bindings: iommu: dart: Add t8103-usb4-dart compatible +- iommufd: Do not UAF during iommufd_put_object() +- iommufd: Add iommufd_ctx to iommufd_put_object() +- iommu/vt-d: Support enforce_cache_coherency only for empty domains +- iommu: Flow ERR_PTR out from __iommu_domain_alloc() +- iommu/dma: Use a large flush queue and timeout for shadow_on_flush +- iommu/dma: Allow a single FQ in addition to per-CPU FQs +- iommu/s390: Disable deferred flush for ISM devices +- s390/pci: Use dma-iommu layer +- s390/pci: prepare is_passed_through() for dma-iommu +- iommu: Allow .iotlb_sync_map to fail and handle s390's -ENOMEM return +- iommu/dart: Remove the force_bypass variable +- iommu/dart: Call apple_dart_finalize_domain() as part of alloc_paging() +- iommu/dart: Convert to domain_alloc_paging() +- iommu/dart: Move the blocked domain support to a global static +- iommu/dart: Use static global identity domains +- iommufd: Convert to alloc_domain_paging() +- iommu/vt-d: Use ops->blocked_domain +- iommu/vt-d: Update the definition of the blocking domain +- iommu: Move IOMMU_DOMAIN_BLOCKED global statics to ops->blocked_domain +- iommu: change iommu_map_sgtable to return signed values +- powerpc/iommu: Do not do platform domain attach atctions after probe +- iommu: Fix return code in iommu_group_alloc_default_domain() +- iommu: Do not use IOMMU_DOMAIN_DMA if CONFIG_IOMMU_DMA is not enabled +- iommu: Remove duplicate include +- iommu: Improve map/unmap sanity checks +- iommu: Retire map/unmap ops +- iommu/tegra-smmu: Update to {map,unmap}_pages +- iommu/sun50i: Update to {map,unmap}_pages +- iommu/rockchip: Update to {map,unmap}_pages +- iommu/omap: Update to {map,unmap}_pages +- iommu/exynos: Update to {map,unmap}_pages +- iommu/omap: Convert to generic_single_device_group() +- iommu/ipmmu-vmsa: Convert to generic_single_device_group() +- iommu/rockchip: Convert to generic_single_device_group() +- iommu/sprd: Convert to generic_single_device_group() +- iommu/sun50i: Convert to generic_single_device_group() +- iommu: Add generic_single_device_group() +- iommu: Remove useless group refcounting +- iommu: Convert remaining simple drivers to domain_alloc_paging() +- iommu: Convert simple drivers with DOMAIN_DMA to domain_alloc_paging() +- iommu: Add ops->domain_alloc_paging() +- iommu: Add __iommu_group_domain_alloc() +- iommu: Require a default_domain for all iommu drivers +- iommu/sun50i: Add an IOMMU_IDENTITIY_DOMAIN +- iommu/mtk_iommu: Add an IOMMU_IDENTITIY_DOMAIN +- iommu/ipmmu: Add an IOMMU_IDENTITIY_DOMAIN +- iommu/qcom_iommu: Add an IOMMU_IDENTITIY_DOMAIN +- iommu: Remove ops->set_platform_dma_ops() +- iommu/msm: Implement an IDENTITY domain +- iommu/omap: Implement an IDENTITY domain +- iommu/tegra-smmu: Support DMA domains in tegra +- iommu/tegra-smmu: Implement an IDENTITY domain +- iommu/exynos: Implement an IDENTITY domain +- iommu: Allow an IDENTITY domain as the default_domain in ARM32 +- iommu: Reorganize iommu_get_default_domain_type() to respect def_domain_type() +- iommu/mtk_iommu_v1: Implement an IDENTITY domain +- iommu/tegra-gart: Remove tegra-gart +- iommu/fsl_pamu: Implement a PLATFORM domain +- iommu: Add IOMMU_DOMAIN_PLATFORM for S390 +- powerpc/iommu: Setup a default domain and remove set_platform_dma_ops +- iommu: Add IOMMU_DOMAIN_PLATFORM +- iommu: Add iommu_ops->identity_domain +- iommu/vt-d: debugfs: Support dumping a specified page table +- iommu/vt-d: debugfs: Create/remove debugfs file per {device, pasid} +- iommu/vt-d: debugfs: Dump entry pointing to huge page +- iommu/virtio: Add __counted_by for struct viommu_request and use struct_size() +- iommu/arm-smmu-v3-sva: Remove bond refcount +- iommu/arm-smmu-v3-sva: Remove unused iommu_sva handle +- iommu/arm-smmu-v3: Rename cdcfg to cd_table +- iommu/arm-smmu-v3: Update comment about STE liveness +- iommu/arm-smmu-v3: Cleanup arm_smmu_domain_finalise +- iommu/arm-smmu-v3: Move CD table to arm_smmu_master +- iommu/arm-smmu-v3: Refactor write_ctx_desc +- iommu/arm-smmu-v3: move stall_enabled to the cd table +- iommu/arm-smmu-v3: Encapsulate ctx_desc_cfg init in alloc_cd_tables +- iommu/arm-smmu-v3: Replace s1_cfg with cdtab_cfg +- iommu/arm-smmu-v3: Move ctx_desc out of s1_cfg +- iommu/tegra-smmu: Drop unnecessary error check for for debugfs_create_dir() +- powerpc: Remove extern from function implementations +- iommufd: Organize the mock domain alloc functions closer to Joerg's tree +- iommu/vt-d: Disallow read-only mappings to nest parent domain +- iommu/vt-d: Add nested domain allocation +- iommu/vt-d: Set the nested domain to a device +- iommu/vt-d: Make domain attach helpers to be extern +- iommu/vt-d: Add helper to setup pasid nested translation +- iommu/vt-d: Add helper for nested domain allocation +- iommu/vt-d: Extend dmar_domain to support nested domain +- iommufd: Add data structure for Intel VT-d stage-1 domain allocation +- iommufd/selftest: Add coverage for IOMMU_HWPT_ALLOC with nested HWPTs +- iommufd/selftest: Add nested domain allocation for mock domain +- iommu: Add iommu_copy_struct_from_user helper +- iommufd: Add a nested HW pagetable object +- iommu: Pass in parent domain with user_data to domain_alloc_user op +- iommufd: Share iommufd_hwpt_alloc with IOMMUFD_OBJ_HWPT_NESTED +- iommufd: Derive iommufd_hwpt_paging from iommufd_hw_pagetable +- iommufd/device: Wrap IOMMUFD_OBJ_HWPT_PAGING-only configurations +- iommufd: Rename IOMMUFD_OBJ_HW_PAGETABLE to IOMMUFD_OBJ_HWPT_PAGING +- iommu: Add IOMMU_DOMAIN_NESTED +- iommufd: Only enforce cache coherency in iommufd_hw_pagetable_alloc +- iommufd: Fix spelling errors in comments +- !4767 reserve space for arch related structures +- kabi: reserve space for struct mfd_cell +- kabi: reserve space for struct irq_work +- !4709 mtd: Fix gluebi NULL pointer dereference caused by ftl notifier +- mtd: Fix gluebi NULL pointer dereference caused by ftl notifier +- !4738 blk-mq: fix IO hang from sbitmap wakeup race +- blk-mq: fix IO hang from sbitmap wakeup race +- !4561 sched: migtate user interface from smart grid to sched bpf +- sched: migtate user interface from smart grid to sched bpf +- !4026 [OLK-6.6]Add support for Mont-TSSE +- add support for Mont-TSSE Driver +- !4564 v2 reserve space for arm64 related structures +- kabi: reserve space for processor.h +- kabi: reserve space for fb.h +- kabi: reserve space for efi.h +- !4675 v5 Backport vDPA migration support patches +- vdpa: add CONFIG_VHOST_VDPA_MIGRATION +- vdpa: add vmstate header file +- vhost-vdpa: add reset state params to indicate reset level +- vhost-vdpa: allow set feature VHOST_F_LOG_ALL when been negotiated. +- vhost-vdpa: fix msi irq request err +- vhost-vdpa: Allow transparent MSI IOV +- vhost: add VHOST feature VHOST_BACKEND_F_BYTEMAPLOG +- vhost-vdpa: add uAPI for device migration status +- vdpa: add vdpa device migration status ops +- vhost-vdpa: add uAPI for device buffer +- vdpa: add device state operations +- vhost-vdpa: add uAPI for logging +- vdpa: add log operations +- !4660 Intel: Backport to fix In Field Scan(IFS) SAF for GNR & SRF +- platform/x86/intel/ifs: Call release_firmware() when handling errors. +- !4652 RDMA/hns: Support SCC context query and DSCP configuration. +- RDMA/hns: Support DSCP of userspace +- RDMA/hns: Append SCC context to the raw dump of QP Resource +- !4628 fs:/dcache.c: fix negative dentry flag warning in dentry_free +- fs:/dcache.c: fix negative dentry flag warning in dentry_free +- !4654 hisi_ptt: Move type check to the beginning of hisi_ptt_pmu_event_init() +- hwtracing: hisi_ptt: Move type check to the beginning of hisi_ptt_pmu_event_init() +- !3880 ima: Add IMA digest lists extension +- ima: add default INITRAMFS_FILE_METADATA and EVM_DEFAULT_HASH CONFIG +- ima: don't allow control characters in policy path +- ima: Add max size for IMA digest database +- config: add digest list options for arm64 and x86 +- evm: Propagate choice of HMAC algorithm in evm_crypto.c +- ima: Execute parser to upload digest lists not recognizable by the kernel +- evm: Extend evm= with x509. allow_metadata_writes and complete values +- ima: Add parser keyword to the policy +- ima: Allow direct upload of digest lists to securityfs +- ima: Search key in the built-in keyrings +- certs: Introduce search_trusted_key() +- KEYS: Provide a function to load keys from a PGP keyring blob +- KEYS: Introduce load_pgp_public_keyring() +- KEYS: Provide PGP key description autogeneration +- KEYS: PGP data parser +- PGPLIB: Basic packet parser +- PGPLIB: PGP definitions (RFC 4880) +- rsa: add parser of raw format +- mpi: introduce mpi_key_length() +- ima: Add Documentation/security/IMA-digest-lists.txt +- ima: Introduce appraise_exec_immutable policy +- ima: Introduce appraise_exec_tcb policy +- ima: Introduce exec_tcb policy +- ima: Add meta_immutable appraisal type +- evm: Add support for digest lists of metadata +- ima: Add support for appraisal with digest lists +- ima: Add support for measurement with digest lists +- ima: Load all digest lists from a directory at boot time +- ima: Introduce new hook DIGEST_LIST_CHECK +- ima: Introduce new securityfs files +- ima: Prevent usage of digest lists not measured or appraised +- ima: Add parser of compact digest list +- ima: Use ima_show_htable_value to show violations and hash table data +- ima: Generalize policy file operations +- ima: Generalize ima_write_policy() and raise uploaded data size limit +- ima: Generalize ima_read_policy() +- ima: Allow choice of file hash algorithm for measurement and audit +- ima: Add enforce-evm and log-evm modes to strictly check EVM status +- init: Add kernel option to force usage of tmpfs for rootfs +- gen_init_cpio: add support for file metadata +- initramfs: read metadata from special file METADATA!!! +- initramfs: add file metadata +- !4542 Support feature TLBI DVMBM +- KVM: arm64: Implement the capability of DVMBM +- KVM: arm64: Add kvm_arch::sched_cpus and sched_lock +- KVM: arm64: Add kvm_vcpu_arch::sched_cpus and pre_sched_cpus +- KVM: arm64: Probe and configure DVMBM capability on HiSi CPUs +- KVM: arm64: Support a new HiSi CPU type +- KVM: arm64: Only probe Hisi ncsnp feature on Hisi CPUs +- KVM: arm64: Add support for probing Hisi ncsnp capability +- KVM: arm64: Probe Hisi CPU TYPE from ACPI/DTB +- !4661 [OLK-6.6] Fix gic support for Phytium S2500 +- Enable CONFIG_ARCH_PHYTIUM +- Fix gic support for Phytium S2500 +- !4644 f2fs: explicitly null-terminate the xattr list +- f2fs: explicitly null-terminate the xattr list +- !4637 Using smmu IIDR registers +- iommu/arm-smmu-v3: Enable iotlb_sync_map according to SMMU_IIDR +- Revert "iommu/arm-smmu-v3: Add a SYNC command to avoid broken page table prefetch" +- !4506 ubi: fastmap: Optimize ubi wl algorithm to improve flash service life +- ubi: fastmap: Add control in 'UBI_IOCATT' ioctl to reserve PEBs for filling pools +- ubi: fastmap: Add module parameter to control reserving filling pool PEBs +- ubi: fastmap: Fix lapsed wear leveling for first 64 PEBs +- ubi: fastmap: Get wl PEB even ec beyonds the 'max' if free PEBs are run out +- ubi: fastmap: may_reserve_for_fm: Don't reserve PEB if fm_anchor exists +- ubi: fastmap: Remove unneeded break condition while filling pools +- ubi: fastmap: Wait until there are enough free PEBs before filling pools +- ubi: fastmap: Use free pebs reserved for bad block handling +- ubi: Replace erase_block() with sync_erase() +- ubi: fastmap: Allocate memory with GFP_NOFS in ubi_update_fastmap +- ubi: fastmap: erase_block: Get erase counter from wl_entry rather than flash +- ubi: fastmap: Fix missed ec updating after erasing old fastmap data block +- !4624 6.6: i2c: Optimized the value setting of maxwrite limit to fifo depth - 1 +- i2c: hisi: Add clearing tx aempty interrupt operation +- i2c: hisi: Optimized the value setting of maxwrite limit to fifo depth - 1 +- !4631 Add kabi reserve +- drm/ttm: Add kabi reserve in ttm_tt.h +- drm/ttm: Add kabi reserve in ttm_resource.h +- drm/ttm: Add kabi reserve in ttm_bo.h +- drm: Add kabi reserve in drm_gpu_scheduler.h +- drm: Add kabi reserve in drm_syncobj.h +- drm: Add kabi reserve in drm_plane.h +- drm: Add kabi reserve in drm_modeset_lock.h +- drm: Add kabi reserve in drm_mode_config.h +- sbitmap: Add kabi reserve +- xarray: Reserve kabi for xa_state +- delayacct: Reserve kabi for task_delay_info + +* Mon Feb 26 2024 huangzq6 - 6.6.0-10.0.0.7 +- add signature for vmlinux + +* Wed Feb 21 2024 Zheng Zengkai - 6.6.0-10.0.0.6 +- !4598 [OLK-6.6] Add iommu support for Phytium S2500 +- Add iommu support for Phytium S2500 +- !4596 add sw64 architecture support +- sw64: fix build support +- sw64: add dynamic turning on/off cores support +- sw64: add dynamic frequency scaling support +- sw64: add kgdb support +- sw64: add jump_label support +- sw64: add uprobe support +- sw64: add kprobe support +- sw64: add kernel relocation support +- sw64: add ftrace support +- sw64: add hibernation support +- sw64: add suspend support +- sw64: add eBPF JIT support +- sw64: add kdump support +- sw64: add kexec support +- sw64: add perf events support +- sw64: add qspinlock support +- sw64: add stacktrace support +- !4567 Support feature TWED +- KVM: arm64: Make use of TWED feature +- arm64: cpufeature: TWED support detection +- !4383 [OLK-6.6] kabi: add more x86/cpu reservations in cpu feature bits and bug bits +- kabi: reserve x86 cpu bug fields +- kabi: reserve x86 cpu capability fields +- !3695 x86: Add x86 related kabi reservations +- x86: Add x86 related kabi reservations +- !4589 fs,hugetlb: fix NULL pointer dereference in hugetlbs_fill_super +- fs,hugetlb: fix NULL pointer dereference in hugetlbs_fill_super +- !4451 v5 kabi reserve patches +- kabi: reserve space for arm64 cpufeature related structure +- kabi: reserve space for power management related structure +- energy_model: Add kabi_reserve +- pm: pm.h: Add kabi_reserve +- pm: pm_domain.h: Add kabi_reserve +- drm: drm_gem.h: Add kabi_reserve +- drm: drm_fourcc.h: Add kabi_reserve +- drm: drm_file.h: Add kabi_reserve +- drm: drm_fb_helper.h: Add kabi_reserve +- drm: drm_drv.h: Add kabi_reserve +- drm: drm_device.h: Add kabi_reserve +- drm: drm_crtc.h: Add kabi_reserve +- drm: drm_connector.h: Add kabi_reserve +- drm: drm_client.h: Add kabi_reserve +- drm: drm_atomic.h: Add kabi_reserve +- irqdomain: Add kabi_reserve in irqdomain +- irq_desc: Add kabi_reserve in irq_desc +- irq: Add kabi_reserve in irq +- interrupt: Add kabi_reserve in interrupt.h +- msi: Add kabi_reserve in msi.h +- kabi: reserve space for struct cpu_stop_work +- KABI: reserve space for struct input_dev +- !4557 Add ZONE_EXTMEM to avoid kabi broken +- openeuler_defconfig: enable CONFIG_ZONE_EXTMEM for arm64 +- mm: add ZONE_EXTMEM for future extension to avoid kabi broken +- !4569 add sw64 architecture support +- sw64: add KVM support +- sw64: add EFI support +- sw64: add DMA support +- sw64: add ACPI support +- sw64: add device trees +- sw64: add MSI support +- sw64: add PCI support +- sw64: add default configs +- sw64: add NUMA support +- sw64: add SMP support +- sw64: add VDSO support +- sw64: add some library functions +- sw64: add some other routines +- sw64: add some common routines +- sw64: add module support +- sw64: add basic IO support +- sw64: add FPU support +- !3498 fuse: reserve space for future expansion +- kabi:fuse: reserve space for future expansion +- !4435 v2 kabi: reserve space for struct ptp_clock +- kabi: reserve space for struct ptp_clock +- !4584 v5 kabi reserve +- kabi: reserve space for struct clocksource +- kabi: reserve space for struct timer_list +- kabi: reserve space for struct ptp_clock_info +- kabi: reserve space for posix clock related structure +- kabi: reserve space for hrtimer related structures +- kabi: reserve space for kobject related structures +- !4049 openeuler_defconfig: Disable new HW_RANDOM support for arm64 +- openeuler_defconfig: Disable new HW_RANDOM support for arm64 +- !4582 cgroup/hugetlb: hugetlb accounting +- mm: memcg: fix split queue list crash when large folio migration +- hugetlb: memcg: account hugetlb-backed memory in memory controller +- memcontrol: only transfer the memcg data for migration +- memcontrol: add helpers for hugetlb memcg accounting +- !4347 【OLK-6.6】AMD: CXL RCH Protocol Error Handling supporting +- openeuler_defconfig: Enable CONFIG_PCIEAER_CXL=y +- cxl/hdm: Fix && vs || bug +- cxl/pci: Change CXL AER support check to use native AER +- cxl/core/regs: Rework cxl_map_pmu_regs() to use map->dev for devm +- cxl/core/regs: Rename phys_addr in cxl_map_component_regs() +- PCI/AER: Unmask RCEC internal errors to enable RCH downstream port error handling +- PCI/AER: Forward RCH downstream port-detected errors to the CXL.mem dev handler +- cxl/pci: Disable root port interrupts in RCH mode +- cxl/pci: Add RCH downstream port error logging +- cxl/pci: Map RCH downstream AER registers for logging protocol errors +- cxl/pci: Update CXL error logging to use RAS register address +- PCI/AER: Refactor cper_print_aer() for use by CXL driver module +- cxl/pci: Add RCH downstream port AER register discovery +- cxl/port: Remove Component Register base address from struct cxl_port +- cxl/pci: Remove Component Register base address from struct cxl_dev_state +- cxl/hdm: Use stored Component Register mappings to map HDM decoder capability +- cxl/pci: Store the endpoint's Component Register mappings in struct cxl_dev_state +- cxl/port: Pre-initialize component register mappings +- cxl/port: Rename @comp_map to @reg_map in struct cxl_register_map +- !4390 [OLK-6.6] Add kdump support for Phytium S2500 +- Add kdump support for Phytium S2500 +- !4459 v2 Introduce page eject for arm64 +- config: update defconfig for PAGE_EJECT +- mm: page_eject: Introuduce page ejection +- mm/memory-failure: introduce soft_online_page +- mm/hwpoison: Export symbol soft_offline_page +- !3699 [OLK-6.6] Enable CONFIG_IOMMUFD and CONFIG_VFIO_DEVICE_CDEV in x86/arm64 defconfig +- defconfig: enable CONFIG_IOMMUFD and CONFIG_VFIO_DEVICE_CDEV +- !4571 scsi: iscsi: kabi: KABI reservation for iscsi_transport +- scsi: iscsi: kabi: KABI reservation for iscsi_transport +- !4546 RDMA/hns: Support MR management +- RDMA/hns: Simplify 'struct hns_roce_hem' allocation +- RDMA/hns: Support adaptive PBL hopnum +- RDMA/hns: Support flexible umem page size +- RDMA/hns: Alloc MTR memory before alloc_mtt() +- RDMA/hns: Refactor mtr_init_buf_cfg() +- RDMA/hns: Refactor mtr find +- !4576 v6 Add support for ecmdq +- iommu/arm-smmu-v3: Allow disabling ECMDQs at boot time +- iommu/arm-smmu-v3: Add support for less than one ECMDQ per core +- iommu/arm-smmu-v3: Add arm_smmu_ecmdq_issue_cmdlist() for non-shared ECMDQ +- iommu/arm-smmu-v3: Ensure that a set of associated commands are inserted in the same ECMDQ +- iommu/arm-smmu-v3: Add support for ECMDQ register mode +- !3697 enable ARM64/X86 CONFIG_BPF_LSM config +- lsm: enable CONFIG_BPF_LSM for use bpf in lsm program +- !4537 mainline cgroup bufix +- cgroup: use legacy_name for cgroup v1 disable info +- blk-cgroup: bypass blkcg_deactivate_policy after destroying +- cgroup: Check for ret during cgroup1_base_files cft addition +- !4438 kabi: reserve space for workqueue subsystem related structure +- kabi: reserve space for workqueue subsystem related structure +- !4570 v2 scsi: reserve space for structures in scsi +- scsi: reserve space for structures in scsi +- !4566 v2 reserve kabi space for some structures +- libnvdimm: reserve space for structures in libnvdimm +- ata: libata: reserve space for structures in libata +- elevator: reserve space for structures in elevator + +* Wed Feb 7 2024 Zheng Zengkai - 6.6.0-9.0.0.5 +- !4545 add sw64 architecture support +- sw64: add signal handling support +- sw64: add system call support +- sw64: add hugetlb support +- sw64: add memory management +- sw64: add hardware match support +- sw64: add process management +- sw64: add exception handling support +- sw64: add irq handling support +- sw64: add timer support +- sw64: add topology setup routine +- sw64: add boot and setup routines +- sw64: add some other headers +- sw64: add ELF support +- sw64: add common headers +- sw64: add atomic/locking headers +- sw64: add CPU definition headers +- sw64: add build infrastructure +- !4423 kabi: reserve space for pci subsystem and thread_info +- kabi: reserve space for pci subsystem related structure +- kabi: reserve space for thread_info structure +- !3997 [OLK-6.6] openEuler-24.03 Phytium S2500 IPMI adaption +- ipmi_si: Phytium S2500 workaround for MMIO-based IPMI +- !3841 Add support for Hygon family 18h model 5h HD-Audio +- ALSA: hda: Fix single byte writing issue for Hygon family 18h model 5h +- ALSA: hda: Add support for Hygon family 18h model 5h HD-Audio +- !3835 Add support for Hygon model 6h L3 PMU +- perf/x86/uncore: Add L3 PMU support for Hygon family 18h model 6h +- !3698 enable ARM64/X86_64 CONFIG_MPTCP/CONFIG_MPTCP_IPV6 config +- mptcp: enable config CONFIG_MPTCP and CONFIG_MPTCP_IPV6 +- !3696 enable ARM64/X86 CONFIG_XDP_SOCKET、CONFIG_XDP_SOCKETS_DIAG config +- xdp: enable config CONFIG_XDP_SOCKETS and CONFIG_XDP_SOCKETS_DIAG +- !3183 [OLK-6.6] Add support Zhaoxin GPIO pinctrl +- configs: add CONFIG_PINCTRL_ZHAOXIN and KX7000 to m +- Add support Zhaoxin GPIO pinctrl +- !4539 nvme: kabi: KABI reservation for nvme_ctrl +- nvme: kabi: KABI reservation for nvme_ctrl +- !4527 v3 block: kabi: KABI reservation for blk-cgroup +- block: kabi: KABI reservation for blk-cgroup +- !4554 v3 kabi: Reserve KABI slots for fs module +- sysfs: kabi: Reserve KABI slots for bin_attribute struct +- profs: kabi: Reserve KABI slots for proc_ops struct +- dax: kabi: Reserve KABI slots for dax_* struct +- fs: kabi: Reserve KABI slots for nameidata struct +- xattr: kabi: Reserve KABI slots for xattr_handler struct +- kernfs: kabi: Reserve KABI slots for kernfs_* struct +- fanotify: kabi: Reserve KABI slots for fsnotify_* struct +- fscrypt: kabi: Reserve KABI slots for fscrypt_operations struct +- !3932 [OLK-6.6] 同步OLK-5.10 SMMU HTTU补丁 +- iommu/arm-smmu-v3: Add Arm SMMU HTTU config +- vfio/iommu_type1: Add support for manual dirty log clear +- vfio/iommu_type1: Optimize dirty bitmap population based on iommu HWDBM +- vfio/iommu_type1: Add HWDBM status maintenance +- iommu/arm-smmu-v3: Realize support_dirty_log iommu ops +- iommu/arm-smmu-v3: Realize clear_dirty_log iommu ops +- iommu/arm-smmu-v3: Realize sync_dirty_log iommu ops +- iommu/arm-smmu-v3: Realize switch_dirty_log iommu ops +- iommu/arm-smmu-v3: Add feature detection for BBML +- iommu/arm-smmu-v3: Enable HTTU for stage1 with io-pgtable mapping +- iommu/io-pgtable-arm: Add and realize clear_dirty_log ops +- iommu/io-pgtable-arm: Add and realize sync_dirty_log ops +- iommu/io-pgtable-arm: Add and realize merge_page ops +- iommu/io-pgtable-arm: Add and realize split_block ops +- iommu/io-pgtable-arm: Add __arm_lpae_set_pte +- iommu/io-pgtable-arm: Add quirk ARM_HD and ARM_BBMLx +- iommu: Introduce dirty log tracking framework +- iommu/arm-smmu-v3: Add support for Hardware Translation Table Update +- !4560 v5 block: reserve kabi space for general block layer structures +- block: reserve kabi space for general block layer structures +- !4168 Reserve syscall entries for kabi compatibility +- kabi: Reserve syscall entries for kabi compatibility +- arch: Reserve map_shadow_stack() syscall number for all architectures +- !4532 v2 fscache: reserve kabi for fscache structures +- fscache: reserve kabi for fscache structures +- !4543 v2 fs/dcache: kabi: KABI reservation for dentry +- fs/dcache: kabi: KABI reservation for dentry +- !4533 quota: kabi: KABI reservation for quota +- quota: kabi: KABI reservation for quota +- !4528 v3 jbd2: kabi: KABI reservation for jbd2 +- jbd2: kabi: KABI reservation for jbd2 +- !4483 block: kabi: KABI reservation for iocontext +- block: kabi: KABI reservation for iocontext +- !4455 scsi: iscsi: kabi: KABI reservation for scsi_transport_iscsi.h +- scsi: iscsi: kabi: KABI reservation for scsi_transport_iscsi.h +- !4456 scsi: scsi_transport_fc: kabi: KABI reservation for scsi_transport_fc +- scsi: scsi_transport_fc: kabi: KABI reservation for scsi_transport_fc +- !4472 nvmet-fc: kabi: KABI reservation for nvme_fc_port_template +- nvmet-fc: kabi: KABI reservation for nvme_fc_port_template +- !4474 scsi: libsas: kabi: KABI reservation for libsas +- scsi: libsas: kabi: KABI reservation for libsas +- !4463 RDMA/hns: Backport bugfix +- RDMA/hns: Fix memory leak in free_mr_init() +- RDMA/hns: Remove unnecessary checks for NULL in mtr_alloc_bufs() +- RDMA/hns: Add a max length of gid table +- RDMA/hns: Response dmac to userspace +- RDMA/hns: Rename the interrupts +- RDMA/hns: Support SW stats with debugfs +- RDMA/hns: Add debugfs to hns RoCE +- RDMA/hns: Fix inappropriate err code for unsupported operations +- !3838 Add support for Hygon model 4h EDAC +- EDAC/amd64: Adjust UMC channel for Hygon family 18h model 6h +- EDAC/amd64: Add support for Hygon family 18h model 6h +- EDAC/amd64: Add support for Hygon family 18h model 5h +- EDAC/mce_amd: Use struct cpuinfo_x86.logical_die_id for Hygon NodeId +- EDAC/amd64: Adjust address translation for Hygon family 18h model 4h +- EDAC/amd64: Add support for Hygon family 18h model 4h +- EDAC/amd64: Get UMC channel from the 6th nibble for Hygon +- !4408 v2 kabi: reserve space for struct acpi_device and acpi_scan_handler +- kabi: reserve space for struct acpi_device and acpi_scan_handler +- !4495 KABI reservation for driver +- audit: kabi: Remove extra semicolons +- ipmi: kabi: KABI reservation for ipmi +- mmc: kabi: KABI reservation for mmc +- mtd: kabi: KABI reservation for mtd +- tty: kabi: KABI reservation for tty +- !3831 Add support for loading Hygon microcode +- x86/microcode/hygon: Add microcode loading support for Hygon processors +- !4356 【OLK-6.6】AMD: support the UMC Performance Counters for Zen4 +- perf vendor events amd: Add Zen 4 memory controller events +- perf/x86/amd/uncore: Pass through error code for initialization failures, instead of -ENODEV +- perf/x86/amd/uncore: Fix uninitialized return value in amd_uncore_init() +- perf/x86/amd/uncore: Add memory controller support +- perf/x86/amd/uncore: Add group exclusivity +- perf/x86/amd/uncore: Use rdmsr if rdpmc is unavailable +- perf/x86/amd/uncore: Move discovery and registration +- perf/x86/amd/uncore: Refactor uncore management +- !4494 v2 writeback: kabi: KABI reservation for writeback +- writeback: kabi: KABI reservation for writeback +- !4491 sched/rt: Fix possible warn when push_rt_task +- sched/rt: Fix possible warn when push_rt_task +- !4396 [OLK-6.6] perf/x86/zhaoxin/uncore: add NULL pointer check after kzalloc +- perf/x86/zhaoxin/uncore: add NULL pointer check after kzalloc +- !4405 mm: improve performance of accounted kernel memory allocations +- mm: kmem: properly initialize local objcg variable in current_obj_cgroup() +- mm: kmem: reimplement get_obj_cgroup_from_current() +- percpu: scoped objcg protection +- mm: kmem: scoped objcg protection +- mm: kmem: make memcg keep a reference to the original objcg +- mm: kmem: add direct objcg pointer to task_struct +- mm: kmem: optimize get_obj_cgroup_from_current() +- !4500 fs: kabi: KABI reservation for vfs +- fs: kabi: KABI reservation for vfs +- !4505 iov_iter: kabi: KABI reservation for iov_iter +- iov_iter: kabi: KABI reservation for iov_iter +- !4486 v2 openeuler_defconfig: enable CONFIG_PAGE_CACHE_LIMIT +- openeuler_defconfig: enable CONFIG_PAGE_CACHE_LIMIT +- !4489 【OLK-6.6】AMD: fix brstack event for AMD Zen CPU +- perf/x86/amd: Reject branch stack for IBS events +- !4376 [OLK-6.6] Add Phytium Display Engine support to the OLK-6.6. +- DRM: Phytium display DRM doc +- DRM: Phytium display DRM driver +- !4385 v2 sched: remove __GENKSYMS__ used +- sched: remove __GENKSYMS__ used +- !4449 memory tiering: calculate abstract distance based on ACPI HMAT +- dax, kmem: calculate abstract distance with general interface +- acpi, hmat: calculate abstract distance with HMAT +- acpi, hmat: refactor hmat_register_target_initiators() +- memory tiering: add abstract distance calculation algorithms management +- !4362 ubifs: Queue up space reservation tasks if retrying many times +- ubifs: Queue up space reservation tasks if retrying many times +- !4450 change zswap's default allocator to zsmalloc +- openeuler_defconfig: set ZSWAP_ZPOOL_DEFAULT to ZSMALLOC +- zswap: change zswap's default allocator to zsmalloc +- !4298 misc for controlling fd +- cgroup/misc: support cgroup misc to control fd +- filescgroup: add adapter for legacy and misc cgroup +- filescgroup: rename filescontrol.c to legacy-filescontrol.c +- filescgroup: Add CONFIG_CGROUP_FILES at files_cgroup in files_struct +- filescgroup: remove files of dfl_cftypes. +- !4173 block: remove precise_iostat +- block: remove precise_iostat +- !4481 cred: kabi: KABI reservation for cred +- cred: kabi: KABI reservation for cred +- !4418 KABI: Add reserve space for sched structures +- KABI: Reserve space for fwnode.h +- KABI: Reserve space for struct module +- fork: Allocate a new task_struct_resvd object for fork task +- KABI: Add reserve space for sched structures +- !4355 v4 kabi reserve for memcg and cgroup_bpf +- cgroup_bpf/kabi: reserve space for cgroup_bpf related structures +- memcg/kabi: reserve space for memcg related structures +- !4476 net/kabi: Reserve space for net structures +- net/kabi: Reserve space for net structures +- !4440 v2 kabi:dma:add kabi reserve for dma_map_ops structure +- kabi:dma:add kabi reserve for dma_map_ops structure +- !4479 mm/memcontrol: fix out-of-bound access in mem_cgroup_sysctls_init +- mm/memcontrol: fix out-of-bound access in mem_cgroup_sysctls_init +- !4429 Remove unnecessary KABI reservation +- crypto: kabi: Removed unnecessary KABI reservation +- !4211 blk-mq: avoid housekeeping CPUs scheduling a worker on a non-housekeeping CPU +- blk-mq: avoid housekeeping CPUs scheduling a worker on a non-housekeeping CPU +- !4407 sched/topology: Fix cpus hotplug deadlock in check_node_limit() +- sched/topology: Fix cpus hotplug deadlock in check_node_limit() +- !4351 kabi: net: reserve space for net subsystem related structure +- kabi: net: reserve space for net subsystem related structure +- !4453 arm64/ascend: Make enable_oom_killer feature depends on ASCEND_FEATURE +- arm64/ascend: Make enable_oom_killer feature depends on ASCEND_FEATURE +- !4386 fix static scanning issues +- bond: fix static scanning issue with bond_broadcast_arp_or_nd_table_header +- tcp: fix static scanning issue with sysctl_local_port_allocation +- !4403 v2 kabi: net: reserve space for net related structure +- kabi: net: reserve space for net related structure +- !4406 v2 net/kabi: reserve space for net related structures +- net/kabi: reserve space for net related structures +- !4398 v2 vfs: reserve kabi space for vfs related structures +- vfs: reserve kabi space for vfs related structures +- !4372 kabi: reserve space for struct rate_sample +- kabi: reserve space for struct rate_sample +- !4322 cgroup_writeback: fix deadlock +- cgroup_writeback: fix deadlock in cgroup1_writeback +- !4414 Support srq record doorbell and support query srq context +- RDMA/hns: Support SRQ record doorbell +- RDMA/hns: Support SRQ restrack ops for hns driver +- RDMA/core: Add support to dump SRQ resource in RAW format +- RDMA/core: Add dedicated SRQ resource tracker function +- !4165 tlb: reserve fields for struct mmu_gather +- tlb: reserve fields for struct mmu_gather +- !4178 OLK-6.6 cred backport for kabi reserve +- cred: get rid of CONFIG_DEBUG_CREDENTIALS +- groups: Convert group_info.usage to refcount_t +- cred: switch to using atomic_long_t +- cred: add get_cred_many and put_cred_many +- !4343 v3 reserve KABI slots for file system or storage related structures +- mtd: kabi: Reserve KABI slots for mtd_device_xxx_register() related structures +- pipe: kabi: Reserve KABI slots for pipe_inode_info structure +- exportfs: kabi: Reserve KABI slots for export_operations structure +- !4200 Expose swapcache stat for memcg v1 +- memcg: remove unused do_memsw_account in memcg1_stat_format +- memcg: expose swapcache stat for memcg v1 +- !4140 backport some patches for kunpeng hccs +- soc: hisilicon: kunpeng_hccs: Support the platform with PCC type3 and interrupt ack +- doc: kunpeng_hccs: Fix incorrect email domain name +- soc: hisilicon: kunpeng_hccs: Remove an unused blank line +- soc: hisilicon: kunpeng_hccs: Add failure log for no _CRS method +- soc: hisilicon: kunpeng_hccs: Fix some incorrect format strings +- soc/hisilicon: kunpeng_hccs: Convert to platform remove callback returning void +- soc: kunpeng_hccs: Migrate to use generic PCC shmem related macros +- hwmon: (xgene) Migrate to use generic PCC shmem related macros +- i2c: xgene-slimpro: Migrate to use generic PCC shmem related macros +- ACPI: PCC: Add PCC shared memory region command and status bitfields +- !3641 Make the cpuinfo_cur_freq interface read correctly +- cpufreq: CPPC: Keep the target core awake when reading its cpufreq rate +- arm64: cpufeature: Export cpu_has_amu_feat() +- !4410 config: Update openeuler_defconfig base on current +- config: x86: Update openeuler_defconfig base on current source code +- config: arm64: Update openeuler_defconfig base on current source code +- !4400 v2 soc: hisilicon: hisi_hbmdev: Fix compile error +- soc: hisilicon: hisi_hbmdev: Fix compile error +- !4397 v2 cryptd: kabi: Fixed boot panic +- cryptd: kabi: Fixed boot panic +- !4393 [OLK-6.6] crypto: sm4: fix the build warning issue of sm4 driver +- crypto: sm4: fix the build warning issue of sm4 driver +- !4368 cgroup/misc: fix compiling waring +- cgroup/misc: fix compiling waring +- !4364 [OLK-6.6] crypto: sm3/sm4: fix zhaoxin sm3/sm4 driver file name mismatch issue +- crypto: sm3/sm4: fix zhaoxin sm3/sm4 driver file name mismatch issue +- !4204 arm64: Turn on CONFIG_IPI_AS_NMI in openeuler_defconfig +- arm64: Turn on CONFIG_IPI_AS_NMI in openeuler_defconfig +- !4314 tracing: Reserve kabi fields +- tracing: Reserve kabi fields +- !4301 v3 kabi: reserve space for cpu cgroup and cpuset cgroup related structures +- kabi: reserve space for cpu cgroup and cpuset cgroup related structures +- !4177 kabi: reserve space for bpf related structures +- kabi: reserve space for bpf related structures +- !4354 v7 KABI reservation for IMA and crypto +- ima: kabi: KABI reservation for IMA +- crypto: kabi: KABI reservation for crypto +- !4346 v2 pciehp: fix a race between pciehp and removing operations by sysfs +- pciehp: fix a race between pciehp and removing operations by sysfs +- !4146 tcp: fix compilation issue when CONFIG_SYSCTL is disabled +- tcp: fix compilation issue when CONFIG_SYSCTL is disabled +- !4066 smb: client: fix OOB in receive_encrypted_standard() +- smb: client: fix OOB in receive_encrypted_standard() +- !3995 net: config: enable network config +- net: config: enable network config +- !3745 【OLK-6.6】Support SMT control on arm64 +- config: enable CONFIG_HOTPLUG_SMT for arm64 +- arm64: Kconfig: Enable HOTPLUG_SMT +- arm64: topology: Support SMT control on ACPI based system +- arch_topology: Support SMT control for OF based system +- arch_topology: Support basic SMT control for the driver +- !4000 audit: kabi: KABI reservation for audit +- audit: kabi: KABI reservation for audit +- !4249 ubifs: fix possible dereference after free +- ubifs: fix possible dereference after free +- !3178 [OLK-6.6] Driver for Zhaoxin SM3 and SM4 algorithm +- configs: Add Zhaoxin SM3 and SM4 algorithm configs +- Add support for Zhaoxin GMI SM4 Block Cipher algorithm +- Add support for Zhaoxin GMI SM3 Secure Hash algorithm +- !4219 Initial cleanups for vCPU hotplug +- riscv: convert to use arch_cpu_is_hotpluggable() +- riscv: Switch over to GENERIC_CPU_DEVICES +- LoongArch: convert to use arch_cpu_is_hotpluggable() +- LoongArch: Use the __weak version of arch_unregister_cpu() +- LoongArch: Switch over to GENERIC_CPU_DEVICES +- x86/topology: convert to use arch_cpu_is_hotpluggable() +- x86/topology: use weak version of arch_unregister_cpu() +- x86/topology: Switch over to GENERIC_CPU_DEVICES +- arm64: convert to arch_cpu_is_hotpluggable() +- arm64: setup: Switch over to GENERIC_CPU_DEVICES using arch_register_cpu() +- drivers: base: Print a warning instead of panic() when register_cpu() fails +- drivers: base: Move cpu_dev_init() after node_dev_init() +- drivers: base: add arch_cpu_is_hotpluggable() +- drivers: base: Implement weak arch_unregister_cpu() +- drivers: base: Allow parts of GENERIC_CPU_DEVICES to be overridden +- drivers: base: Use present CPUs in GENERIC_CPU_DEVICES +- ACPI: Move ACPI_HOTPLUG_CPU to be disabled on arm64 and riscv +- Loongarch: remove arch_*register_cpu() exports +- x86/topology: remove arch_*register_cpu() exports +- x86: intel_epb: Don't rely on link order +- arch_topology: Make register_cpu_capacity_sysctl() tolerant to late CPUs +- arm64, irqchip/gic-v3, ACPI: Move MADT GICC enabled check into a helper +- ACPI: scan: Rename acpi_scan_device_not_present() to be about enumeration +- ACPI: scan: Use the acpi_device_is_present() helper in more places +- !4215 pci: Enable acs for QLogic HBA cards +- pci: Enable acs for QLogic HBA cards +- !4267 ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16() +- ksmbd: fix slab-out-of-bounds in smb_strndup_from_utf16() +- !4317 [OLK-6.6] cputemp: zhaoxin: fix HWMON_THERMAL namespace not import issue +- cputemp: zhaoxin: fix HWMON_THERMAL namespace not import issue. +- !3682 cgroup and ns kabi reserve +- cgroup/misc: reserve kabi for future misc development +- cgroup/psi: reserve kabi for future psi development +- namespace: kabi: reserve for future namespace development +- cgroup: kabi: reserve space for cgroup frame +- !4291 fs:/dcache.c: fix negative dentry limit not complete problem +- fs:/dcache.c: fix negative dentry limit not complete problem +- !4292 powerpc: Add PVN support for HeXin C2000 processor +- powerpc: Add PVN support for HeXin C2000 processor +- !3129 [OLK-6.6] Driver for Zhaoxin AES and SHA algorithm +- Add Zhaoxin aes/sha items in openeuler_config +- Add support for Zhaoxin SHA algorithm +- Add support for Zhaoxin AES algorithm +- !3959 kabi: mm: add kabi reserve for mm structure +- kabi: mm: add kabi reserve for mm structure +- !4046 [OLK-6.6] Add gic support for Phytium S2500 +- Add gic support for Phytium S2500 +- !3126 [OLK-6.6] Driver for Zhaoxin HW Random Number Generator +- Add CONFIG_HW_RANDOM_ZHAOXIN in openeuler_defconfig +- Add support for Zhaoxin HW Random Number Generator +- !3169 [OLK-6.6] x86/perf: Add uncore performance events support for Zhaoxin CPU +- x86/perf: Add uncore performance events support for Zhaoxin CPU +- !3187 [OLK-6.6] Add support for Zhaoxin I2C controller +- configs: add CONFIG_I2C_ZHAOXIN to m +- Add support for Zhaoxin I2C controller +- !4164 arch/mm/fault: fix major fault accounting when retrying under per-VMA lock +- arch/mm/fault: fix major fault accounting when retrying under per-VMA lock +- !3903 kabi: Reserve space for perf subsystem related structures +- kabi: Reserve space for perf subsystem related structures +- !4128 drm/qxl: Fix missing free_irq +- drm/qxl: Fix missing free_irq +- !4050 kabi: net: reserve space for net +- kabi: net: reserve space for net sunrpc subsystem related structure +- kabi: net: reserve space for net rdma subsystem related structure +- kabi: net: reserve space for net netfilter subsystem related structure +- kabi: net: reserve space for net can subsystem related structure +- kabi: net: reserve space for net bpf subsystem related structure +- kabi: net: reserve space for net base subsystem related structure +- !3774 [OLK-6.6] sched/fair: Scan cluster before scanning LLC in wake-up path +- sched/fair: Use candidate prev/recent_used CPU if scanning failed for cluster wakeup +- sched/fair: Scan cluster before scanning LLC in wake-up path +- sched: Add cpus_share_resources API +- !3125 [OLK-6.6] Driver for Zhaoxin Serial ATA IDE +- configs: enable CONFIG_SATA_ZHAOXIN to y +- Add support for Zhaoxin Serial ATA IDE. +- !4044 Set CONFIG_NODES_SHIFT to 8 +- openeuler_defconfig: set CONFIG_NODES_SHIFT to 8 for both x86_64/ARM64 +- x86/Kconfig: allow NODES_SHIFT to be set on MAXSMP +- !3840 Remove Hygon SMBus IMC detecting +- i2c-piix4: Remove the IMC detecting for Hygon SMBus +- !3839 Add support for Hygon model 4h k10temp +- hwmon/k10temp: Add support for Hygon family 18h model 5h +- hwmon/k10temp: Add support for Hygon family 18h model 4h +- !3837 Add support for Hygon model 4h northbridge +- x86/amd_nb: Add support for Hygon family 18h model 6h +- x86/amd_nb: Add support for Hygon family 18h model 5h +- x86/amd_nb: Add northbridge support for Hygon family 18h model 4h +- x86/amd_nb: Add Hygon family 18h model 4h PCI IDs +- !4199 Support large folio for mlock +- mm: mlock: avoid folio_within_range() on KSM pages +- mm: mlock: update mlock_pte_range to handle large folio +- mm: handle large folio when large folio in VM_LOCKED VMA range +- mm: add functions folio_in_range() and folio_within_vma() +- !4147 arm64: Add CONFIG_IPI_AS_NMI to IPI as NMI feature +- arm64: Add CONFIG_IPI_AS_NMI to IPI as NMI feature +- !4159 Backport iommufd dirty tracking from v6.7 +- iommu/vt-d: Set variable intel_dirty_ops to static +- iommufd/selftest: Fix _test_mock_dirty_bitmaps() +- iommufd/selftest: Fix page-size check in iommufd_test_dirty() +- iommu/vt-d: Enhance capability check for nested parent domain allocation +- iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP_NO_CLEAR flag +- iommufd/selftest: Test out_capabilities in IOMMU_GET_HW_INFO +- iommufd/selftest: Test IOMMU_HWPT_GET_DIRTY_BITMAP +- iommufd/selftest: Test IOMMU_HWPT_SET_DIRTY_TRACKING +- iommufd/selftest: Test IOMMU_HWPT_ALLOC_DIRTY_TRACKING +- iommufd/selftest: Expand mock_domain with dev_flags +- iommu/vt-d: Access/Dirty bit support for SS domains +- iommu/amd: Access/Dirty bit support in IOPTEs +- iommu/amd: Add domain_alloc_user based domain allocation +- iommufd: Add a flag to skip clearing of IOPTE dirty +- iommufd: Add capabilities to IOMMU_GET_HW_INFO +- iommufd: Add IOMMU_HWPT_GET_DIRTY_BITMAP +- iommufd: Add IOMMU_HWPT_SET_DIRTY_TRACKING +- iommufd: Add a flag to enforce dirty tracking on attach +- iommufd: Correct IOMMU_HWPT_ALLOC_NEST_PARENT description +- iommu: Add iommu_domain ops for dirty tracking +- iommufd/iova_bitmap: Move symbols to IOMMUFD namespace +- vfio: Move iova_bitmap into iommufd +- vfio/iova_bitmap: Export more API symbols +- iommufd/selftest: Rework TEST_LENGTH to test min_size explicitly +- iommu/vt-d: Add domain_alloc_user op +- iommufd/selftest: Add domain_alloc_user() support in iommu mock +- iommufd/selftest: Iterate idev_ids in mock_domain's alloc_hwpt test +- iommufd: Support allocating nested parent domain +- iommufd: Flow user flags for domain allocation to domain_alloc_user() +- iommufd: Use the domain_alloc_user() op for domain allocation +- iommu: Add new iommu op to create domains owned by userspace +- !4109 PCI: add a member in 'struct pci_bus' to record the original 'pci_ops' +- PCI: add a member in 'struct pci_bus' to record the original 'pci_ops' +- !4108 PCI/AER: increments pci bus reference count in aer-inject process +- PCI/AER: increments pci bus reference count in aer-inject process +- !4114 pci: do not save 'PCI_BRIDGE_CTL_BUS_RESET' +- pci: do not save 'PCI_BRIDGE_CTL_BUS_RESET' +- !4113 PCI: check BIR before mapping MSI-X Table +- PCI: check BIR before mapping MSI-X Table +- !4112 PCI: Fail MSI-X mapping if MSI-X Table offset is out of range of BAR space +- PCI: Fail MSI-X mapping if MSI-X Table offset is out of range of BAR space +- !4110 PCI: Add MCFG quirks for some Hisilicon Chip host controllers +- PCI: Add MCFG quirks for some Hisilicon Chip host controllers +- !4111 sysrq: avoid concurrently info printing by 'sysrq-trigger' +- sysrq: avoid concurrently info printing by 'sysrq-trigger' +- !4107 ntp: Avoid undefined behaviour in second_overflow() +- ntp: Avoid undefined behaviour in second_overflow() +- !4105 PCI/sysfs: Take reference on device to be removed +- PCI/sysfs: Take reference on device to be removed +- !3836 Add support for Hygon model 4h QoS +- x86/resctrl: Add Hygon QoS support +- !4154 Add per-node vmstat info and memcg info +- mm/vmstat: move pgdemote_* out of CONFIG_NUMA_BALANCING +- mm/vmstat: move pgdemote_* to per-node stats +- mm: memcg: add THP swap out info for anonymous reclaim +- !4170 mm/ksm: generalize ksm_process_profit +- mm/ksm: generalize ksm_process_profit +- !4120 arm_mpam: support mpam feature in OLK-6.6 +- arm_mpam: control memory bandwidth with hard limit flag +- fs/resctrl: Remove the limit on the number of CLOSID +- arm_mpam: resctrl: Update the rmid reallocation limit +- arm_mpam: resctrl: Call resctrl_exit() in the event of errors +- arm_mpam: resctrl: Tell resctrl about cpu/domain online/offline +- perf/arm-cmn: Stop claiming all the resources +- arm64: mpam: Select ARCH_HAS_CPU_RESCTRL +- arm_mpam: resctrl: Add dummy definition for free running counters +- arm_mpam: resctrl: Add empty definitions for fine-grained enables +- arm_mpam: resctrl: Add empty definitions for pseudo lock +- untested: arm_mpam: resctrl: Allow monitors to be configured +- arm_mpam: resctrl: Add resctrl_arch_rmid_read() and resctrl_arch_reset_rmid() +- arm_mpam: resctrl: Allow resctrl to allocate monitors +- untested: arm_mpam: resctrl: Add support for mbm counters +- untested: arm_mpam: resctrl: Add support for MB resource +- arm_mpam: resctrl: Add rmid index helpers +- arm64: mpam: Add helpers to change a tasks and cpu mpam partid/pmg values +- arm_mpam: resctrl: Add CDP emulation +- arm_mpam: resctrl: Implement helpers to update configuration +- arm_mpam: resctrl: Add resctrl_arch_get_config() +- arm_mpam: resctrl: Implement resctrl_arch_reset_resources() +- arm_mpam: resctrl: Pick a value for num_rmid +- arm_mpam: resctrl: Pick the caches we will use as resctrl resources +- arm_mpam: resctrl: Add boilerplate cpuhp and domain allocation +- arm_mpam: Add helper to reset saved mbwu state +- arm_mpam: Use long MBWU counters if supported +- arm_mpam: Probe for long/lwd mbwu counters +- arm_mpam: Track bandwidth counter state for overflow and power management +- arm_mpam: Add mpam_msmon_read() to read monitor value +- arm_mpam: Add helpers to allocate monitors +- arm_mpam: Probe and reset the rest of the features +- arm_mpam: Allow configuration to be applied and restored during cpu online +- arm_mpam: Use the arch static key to indicate when mpam is enabled +- arm_mpam: Register and enable IRQs +- arm_mpam: Extend reset logic to allow devices to be reset any time +- arm_mpam: Add a helper to touch an MSC from any CPU +- arm_mpam: Reset MSC controls from cpu hp callbacks +- arm_mpam: Merge supported features during mpam_enable() into mpam_class +- arm_mpam: Probe the hardware features resctrl supports +- arm_mpam: Probe MSCs to find the supported partid/pmg values +- arm_mpam: Add cpuhp callbacks to probe MSC hardware +- arm_mpam: Add MPAM MSC register layout definitions +- arm_mpam: Add the class and component structures for ris firmware described +- arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate +- dt-bindings: arm: Add MPAM MSC binding +- ACPI / MPAM: Parse the MPAM table +- drivers: base: cacheinfo: Add helper to find the cache size from cpu+level +- cacheinfo: Expose the code to generate a cache-id from a device_node +- cacheinfo: Set cache 'id' based on DT data +- cacheinfo: Allow for >32-bit cache 'id' +- ACPI / PPTT: Add a helper to fill a cpumask from a cache_id +- ACPI / PPTT: Add a helper to fill a cpumask from a processor container +- ACPI / PPTT: Find PPTT cache level by ID +- ACPI / PPTT: Provide a helper to walk processor containers +- untested: KVM: arm64: Force guest EL1 to use user-space's partid configuration +- arm64: mpam: Context switch the MPAM registers +- KVM: arm64: Disable MPAM visibility by default, and handle traps +- KVM: arm64: Fix missing traps of guest accesses to the MPAM registers +- arm64: cpufeature: discover CPU support for MPAM +- arm64: head.S: Initialise MPAM EL2 registers and disable traps +- x86/resctrl: Move the filesystem portions of resctrl to live in '/fs/' +- x86/resctrl: Move the filesystem bits to headers visible to fs/resctrl +- fs/resctrl: Add boiler plate for external resctrl code +- x86/resctrl: Drop __init/__exit on assorted symbols +- x86/resctrl: Describe resctrl's bitmap size assumptions +- x86/resctrl: Claim get_domain_from_cpu() for resctrl +- x86/resctrl: Move get_config_index() to a header +- x86/resctrl: Move thread_throttle_mode_init() to be managed by resctrl +- x86/resctrl: Make resctrl_arch_pseudo_lock_fn() take a plr +- x86/resctrl: Make prefetch_disable_bits belong to the arch code +- x86/resctrl: Allow an architecture to disable pseudo lock +- x86/resctrl: Allow resctrl_arch_mon_event_config_write() to return an error +- x86/resctrl: Change mon_event_config_{read,write}() to be arch helpers +- x86/resctrl: Add resctrl_arch_is_evt_configurable() to abstract BMEC +- x86/resctrl: Export the is_mbm_*_enabled() helpers to asm/resctrl.h +- x86/resctrl: Stop using the for_each_*_rdt_resource() walkers +- x86/resctrl: Move max_{name,data}_width into resctrl code +- x86/resctrl: Move monitor exit work to a restrl exit call +- x86/resctrl: Move monitor init work to a resctrl init call +- x86/resctrl: Add a resctrl helper to reset all the resources +- x86/resctrl: Move resctrl types to a separate header +- x86/resctrl: Wrap resctrl_arch_find_domain() around rdt_find_domain() +- x86/resctrl: Export resctrl fs's init function +- x86/resctrl: Remove rdtgroup from update_cpu_closid_rmid() +- x86/resctrl: Add helper for setting CPU default properties +- x86/resctrl: Move ctrlval string parsing links away from the arch code +- x86/resctrl: Add a helper to avoid reaching into the arch code resource list +- x86/resctrl: Separate arch and fs resctrl locks +- x86/resctrl: Move domain helper migration into resctrl_offline_cpu() +- x86/resctrl: Add CPU offline callback for resctrl work +- x86/resctrl: Allow overflow/limbo handlers to be scheduled on any-but cpu +- x86/resctrl: Add CPU online callback for resctrl work +- x86/resctrl: Add helpers for system wide mon/alloc capable +- x86/resctrl: Make rdt_enable_key the arch's decision to switch +- x86/resctrl: Move alloc/mon static keys into helpers +- x86/resctrl: Make resctrl_mounted checks explicit +- x86/resctrl: Allow arch to allocate memory needed in resctrl_arch_rmid_read() +- x86/resctrl: Allow resctrl_arch_rmid_read() to sleep +- x86/resctrl: Queue mon_event_read() instead of sending an IPI +- x86/resctrl: Add cpumask_any_housekeeping() for limbo/overflow +- x86/resctrl: Move CLOSID/RMID matching and setting to use helpers +- x86/resctrl: Allocate the cleanest CLOSID by searching closid_num_dirty_rmid +- x86/resctrl: Use __set_bit()/__clear_bit() instead of open coding +- x86/resctrl: Track the number of dirty RMID a CLOSID has +- x86/resctrl: Allow RMID allocation to be scoped by CLOSID +- x86/resctrl: Access per-rmid structures by index +- x86/resctrl: Track the closid with the rmid +- x86/resctrl: Move rmid allocation out of mkdir_rdt_prepare() +- x86/resctrl: Create helper for RMID allocation and mondata dir creation +- x86/resctrl: kfree() rmid_ptrs from resctrl_exit() +- tick/nohz: Move tick_nohz_full_mask declaration outside the #ifdef +- x86/resctrl: Display RMID of resource group +- x86/resctrl: Add support for the files of MON groups only +- x86/resctrl: Display CLOSID for resource group +- x86/resctrl: Introduce "-o debug" mount option +- x86/resctrl: Move default group file creation to mount +- x86/resctrl: Unwind properly from rdt_enable_ctx() +- x86/resctrl: Rename rftype flags for consistency +- x86/resctrl: Simplify rftype flag definitions +- x86/resctrl: Add multiple tasks to the resctrl group at once +- x86/resctrl: Fix remaining kernel-doc warnings +- !3834 Add support for Hygon model 4h IOAPIC +- iommu/hygon: Add support for Hygon family 18h model 4h IOAPIC +- !3830 Add support for Hygon model 5h CPU cache +- x86/cpu: Get LLC ID for Hygon family 18h model 5h +- !3311 Add support for Hygon model 4h CPU topology +- x86/cpu/hygon: Fix __max_die_per_package for Hygon family 18h model 4h +- !3124 [OLK-6.6] Add support for Zhaoxin HDAC and codec +- ALSA: hda: Add support of Zhaoxin NB HDAC codec +- ALSA: hda: Add support of Zhaoxin NB HDAC +- ALSA: hda: Add support of Zhaoxin SB HDAC +- !3098 [OLK-6.6] Add support for Zhaoxin Processors +- x86/cpu: Add detect extended topology for Zhaoxin CPUs +- x86/cpufeatures: Add Zhaoxin feature bits +- !3742 arch/powerpc: add ppc little endian openuler defconfig +- arch/powerpc: add ppc little endian openuler defconfig +- !4099 Intel: Backport SRF LBR branch counter support to kernel v6.6 +- perf/x86/intel: Support branch counters logging +- perf/x86/intel: Reorganize attrs and is_visible +- perf: Add branch_sample_call_stack +- perf/x86: Add PERF_X86_EVENT_NEEDS_BRANCH_STACK flag +- perf: Add branch stack counters +- !3177 [OLK-6.6] Add MWAIT Cx support for Zhaoxin CPUs +- Add MWAIT Cx support for Zhaoxin CPUs +- !3170 [OLK-6.6] rtc: Fix set RTC time delay 500ms on some Zhaoxin SOCs +- rtc: Fix set RTC time delay 500ms on some Zhaoxin SOCs +- !3131 [OLK-6.6] Driver for Zhaoxin CPU core temperature monitoring +- Add CONFIG_SENSORS_ZHAOXIN_CPUTEMP in openeuler_defconfig +- Add support for Zhaoxin core temperature monitoring +- !3102 [OLK-6.6] x86/mce: Add Centaur MCA support +- x86/mce: Add Centaur MCA support +- !4116 Intel: Backport GNR/SRF PMU uncore support to kernel v6.6 +- perf/x86/intel/uncore: Support Sierra Forest and Grand Ridge +- perf/x86/intel/uncore: Support IIO free-running counters on GNR +- perf/x86/intel/uncore: Support Granite Rapids +- perf/x86/uncore: Use u64 to replace unsigned for the uncore offsets array +- perf/x86/intel/uncore: Generic uncore_get_uncores and MMIO format of SPR +- !4115 Intel: Backport In Field Scan(IFS) SAF & Array BIST support for GNR & SRF +- platform/x86/intel/ifs: ARRAY BIST for Sierra Forest +- platform/x86/intel/ifs: Add new error code +- platform/x86/intel/ifs: Add new CPU support +- platform/x86/intel/ifs: Metadata validation for start_chunk +- platform/x86/intel/ifs: Validate image size +- platform/x86/intel/ifs: Gen2 Scan test support +- platform/x86/intel/ifs: Gen2 scan image loading +- platform/x86/intel/ifs: Refactor image loading code +- platform/x86/intel/ifs: Store IFS generation number +- !4103 [OLK-6.6] Intel: microcode restructuring backport +- x86/setup: Make relocated_ramdisk a local variable of relocate_initrd() +- x86/microcode/intel: Add a minimum required revision for late loading +- x86/microcode: Prepare for minimal revision check +- x86/microcode: Handle "offline" CPUs correctly +- x86/apic: Provide apic_force_nmi_on_cpu() +- x86/microcode: Protect against instrumentation +- x86/microcode: Rendezvous and load in NMI +- x86/microcode: Replace the all-in-one rendevous handler +- x86/microcode: Provide new control functions +- x86/microcode: Add per CPU control field +- x86/microcode: Add per CPU result state +- x86/microcode: Sanitize __wait_for_cpus() +- x86/microcode: Clarify the late load logic +- x86/microcode: Handle "nosmt" correctly +- x86/microcode: Clean up mc_cpu_down_prep() +- x86/microcode: Get rid of the schedule work indirection +- x86/microcode: Mop up early loading leftovers +- x86/microcode/amd: Use cached microcode for AP load +- x86/microcode/amd: Cache builtin/initrd microcode early +- x86/microcode/amd: Cache builtin microcode too +- x86/microcode/amd: Use correct per CPU ucode_cpu_info +- x86/microcode: Remove pointless apply() invocation +- x86/microcode/intel: Rework intel_find_matching_signature() +- x86/microcode/intel: Reuse intel_cpu_collect_info() +- x86/microcode/intel: Rework intel_cpu_collect_info() +- x86/microcode/intel: Unify microcode apply() functions +- x86/microcode/intel: Switch to kvmalloc() +- x86/microcode/intel: Save the microcode only after a successful late-load +- x86/microcode/intel: Simplify early loading +- x86/microcode/intel: Cleanup code further +- x86/microcode/intel: Simplify and rename generic_load_microcode() +- x86/microcode/intel: Simplify scan_microcode() +- x86/microcode/intel: Rip out mixed stepping support for Intel CPUs +- x86/microcode/32: Move early loading after paging enable +- x86/boot/32: Temporarily map initrd for microcode loading +- x86/microcode: Provide CONFIG_MICROCODE_INITRD32 +- x86/boot/32: Restructure mk_early_pgtbl_32() +- x86/boot/32: De-uglify the 2/3 level paging difference in mk_early_pgtbl_32() +- x86/boot: Use __pa_nodebug() in mk_early_pgtbl_32() +- x86/boot/32: Disable stackprotector and tracing for mk_early_pgtbl_32() +- x86/microcode/amd: Fix snprintf() format string warning in W=1 build +- !4102 Intel: Backport Sierra Forest(SRF) perf cstate support to kernel OLK-6.6 +- perf/x86/intel/cstate: Add Grand Ridge support +- perf/x86/intel/cstate: Add Sierra Forest support +- x86/smp: Export symbol cpu_clustergroup_mask() +- perf/x86/intel/cstate: Cleanup duplicate attr_groups +- !4104 arm64: Add the arm64.nolse command line option +- arm64: Add the arm64.nolse command line option +- !4093 introduce smart_grid zone +- smart_grid: introduce smart_grid cmdline +- smart_grid: cpufreq: introduce smart_grid cpufreq control +- smart_grid: introduce smart_grid_strategy_ctrl sysctl +- smart_grid: introduce /proc/pid/smart_grid_level +- sched: introduce smart grid qos zone +- config: enable CONFIG_QOS_SCHED_SMART_GRID by default +- sched: smart grid: init sched_grid_qos structure on QOS purpose +- sched: Introduce smart grid scheduling strategy for cfs + +* Wed Jan 31 2024 Jialin Zhang - 6.6.0-6.0.0.4 +- Module.kabi_aarch64 and Module.kabi_x86_64 v1 + +* Tue Jan 23 2024 Zheng Zengkai - 6.6.0-6.0.0.3 +- !4087 backport two page_owner patchsets: +- mm/page_owner: record and dump free_pid and free_tgid +- tools/mm: update the usage output to be more organized +- tools/mm: fix the default case for page_owner_sort +- tools/mm: filter out timestamps for correct collation +- tools/mm: remove references to free_ts from page_owner_sort +- mm/page_owner: remove free_ts from page_owner output +- !4070 Backport etmem feature to OLK 6.6 +- etmem: enable etmem configurations +- etmem: add original kernel swap enabled options +- etmem: add etmem swap feature +- mm: Export symbol reclaim_pages +- etmem: add etmem scan feature +- mm: Export symbol walk_page_range +- mm: Export symbol __pud_trans_huge_lock +- etmem: add ETMEM scan feature CONFIG to mm/Kconfig +- etmem: add ETMEM feature CONFIG to mm/Kconfig +- !3444 LoongArch: fix some pci problems +- LoongArch: pci root bridige set acpi companion only when not acpi_disabled. +- PCI: irq: Add early_param pci_irq_limit to limit pci irq numbers +- PCI: fix X server auto probe fail when both ast and etnaviv drm present +- PCI: LS7A2000: fix GPU card error +- PCI: LS7A2000: fix pm transition of devices under pcie port +- LoongArch: fix some PCIE card not scanning properly +- PCI: fix kabi error caused by pm_suspend_target_state +- PCI: PM: fix pcie mrrs restoring +- PCI: Check if the pci controller can use both CFG0 and CFG1 mode to access configuration space +- PCI: Check if entry->offset already exist for mem resource +- LS7A2000: Add quirk for OHCI device rev 0x02 +- !4027 [OLK-6.6] Intel RDT non-contiguous CBM support +- Documentation/x86: Document resctrl's new sparse_masks +- x86/resctrl: Add sparse_masks file in info +- x86/resctrl: Enable non-contiguous CBMs in Intel CAT +- x86/resctrl: Rename arch_has_sparse_bitmaps +- !4098 sched: programmable: Fix is_cpu_allowed build error +- sched: programmable: Fix is_cpu_allowed build error +- !4072 cgroup/misc: openeuler_defconfig open misc config by default +- cgroup/misc: openeuler_defconfig open misc config by default +- !4053 sched: basic infrastructure for scheduler bpf +- openeuler_defconfig: enable CONFIG_BPF_SCHED +- sched: programmable: Add hook in can_migrate_task() +- sched: programmable: Add hook in select_task_rq_fair() +- sched: introduce bpf_sched_enable() +- sched: basic infrastructure for scheduler bpf +- sched: programmable: Add user interface of task tag +- sched: programmable: Add user interface of task group tag +- sched: programmable: Add a tag for the task group +- sched: programmable: Add a tag for the task +- sched: programmable: Introduce bpf sched +- !4068 mm/oom_kill: fix NULL pointer dereference in memcg_print_bad_task() +- mm/oom_kill: fix NULL pointer dereference in memcg_print_bad_task() +- !4036 ubi: fix slab-out-of-bounds in ubi_eba_get_ldesc+0xfb/0x130 +- ubi: fix slab-out-of-bounds in ubi_eba_get_ldesc+0xfb/0x130 +- !3971 optimize inlining +- make OPTIMIZE_INLINING config editable +- Revert "compiler: remove CONFIG_OPTIMIZE_INLINING entirely" +- !3631 drm: fix free illegal pointer when create drm_property_blob failed +- drm: fix free illegal pointer when create drm_property_blob failed +- !3958 Revert "drm/prime: Unexport helpers for fd/handle conversion" +- Revert "drm/prime: Unexport helpers for fd/handle conversion" +- !3670 Add initial openeuler_defconfig for riscv64 +- config: add initial openeuler_defconfig for riscv64 +- !3895 Spark SQL scenario bpf readahead optimization synchronization to OLK-6.6 +- selftests/bpf: Update the demo file_read_pattern to run on libbpf 1.0+ +- VFS: Rolling Back the fmode macro definition and structure members +- selftests/bpf: add demo for file read pattern detection +- ext4: add trace for the read and release of regular file +- xfs: add trace for read and release of regular file +- fs: add helper fs_file_read_do_trace() +- vfs: add bare tracepoints for vfs read and release +- readahead: introduce FMODE_CTL_WILLNEED to read first 2MB of file +- !3964 drivers: hooks: add bonding driver vendor hooks +- drivers: hooks: add bonding driver vendor hooks +- !3996 hfs: fix null-ptr-deref in hfs_find_init() +- hfs: fix null-ptr-deref in hfs_find_init() +- !3976 Introduce dynamic pool feature +- mm/dynamic_pool: enable CONFIG_DYNAMIC_POOL on x86_64 and arm64 by default +- mm/dynamic_pool: add Document for dynamic hugetlb feature +- mm/dynamic_pool: compatible with memory hwpoison +- mm/dynamic_pool: compatible with HugeTLB Vmemmap +- mm/dynamic_pool: compatible with HugeTLB dissolve +- mm/dynamic_pool: disable THP for task attached with dpool +- mm/dynamic_pool: fill dpool with pagelist +- mm/dynamic_pool: add tracepoints for dpool +- mm/dynamic_pool: support HugeTLB page allocation from dpool +- mm/dynamic_pool: check resv for HugeTLB allocation from dpool +- mm/dynamic_pool: speed up allocation by percpu pages pool +- mm/dynamic_pool: support page allocation from dpool +- mm/dynamic_pool: prevent task attach to another dpool +- mm/dynamic_pool: call mem_cgroup_force_empty before restore pool +- mm/dynamic_pool: migrate used pages before promote to huge page +- mm/dynamic_pool: support to flow pages between 2M and 4K pages pool +- mm/dynamic_pool: support to flow pages between 1G and 2M pages pool +- mm/dynamic_pool: add restore_pool ops to reclaim memory and restore hugepages +- mm/dynamic_pool: add interface to configure the count of hugepages +- mm/dynamic_pool: fill dpool with HugeTLB 1G pages +- mm/dynamic_pool: create dpool by dhugetlb.nr_pages interface +- mm/dynamic_pool: introduce PG_pool to mark pages allocated from dpool +- mm/dynamic_pool: introduce PG_dpool to mark free pages in dpool +- mm/dynamic_pool: introduce per-memcg memory pool +- mm/memcg: introduce memcg_has_children to check memcg +- mm/memcg: introduce mem_cgroup_scan_cgroups to scan all memcgs +- !3833 xfs: fix block space problems +- xfs: longest free extent no need consider postalloc +- xfs: fix xfs shutdown since we reserve more blocks in agfl fixup +- xfs: set minleft correctly for randomly sparse inode allocations +- xfs: account extra freespace btree splits for multiple allocations +- !3902 xfs: update the last_sync_lsn with ctx start lsn +- xfs: update the last_sync_lsn with ctx start lsn +- !3977 Terrace Service Acceleration +- bpf, sockmap: Add sk_rmem_alloc check for sockmap +- bpf: Add new bpf helper to get SO_ORIGINAL_DST/REPLY_SRC +- bpf: Add bpf_get_sockops_uid_gid helper function +- net: core: Add a GID field to struct sock. +- !3974 Add support for mbigen to generate SPIs +- dt-bindings/irqchip/mbigen: add example of MBIGEN generate SPIs +- irqchip/mbigen: add support for a MBIGEN generating SPIs +- irqchip/mbigen: rename register marcros +- !3963 block: Add config to show info about opening a mounted device for write +- add config about writing mounted devices in openeuler_defconfig +- block: Show info about opening a lower device for write while upper-layers mounted +- block: Add config option to show info about opening a mounted device for write +- block: Add config option to detect writing to part0 while partitions mounted +- block: Expand the meaning of bdev_allow_write_mounted +- block: Record writing and mounting regardless of whether bdev_allow_write_mounted is set +- !3921 mm: mem_reliable: Introduce memory reliable +- config: enable MEMORY_RELIABLE by default +- mm: mem_reliable: Show debug info about memory reliable if oom occurs +- mm: mem_reliable: Introduce proc interface to disable memory reliable features +- proc: mem_reliable: Count reliable memory usage of reliable tasks +- mm: mem_reliable: Introduce fallback mechanism for memory reliable +- mm: mem_reliable: Add limiting the usage of reliable memory +- mm: mem_reliable: Show reliable meminfo +- mm: mem_reliable: Count reliable shmem usage +- mm: mem_reliable: Count reliable page cache usage +- mm: mem_reliable: Add cmdline reliable_debug to enable separate feature +- mm/hugetlb: Allocate non-mirrored memory by default +- mm/memblock: Introduce ability to alloc memory from specify memory region +- mm: mem_reliable: Add memory reliable support during hugepaged collapse +- mm: mem_reliable: Alloc pagecache from reliable region +- shmem: mem_reliable: Alloc shmem from reliable region +- mm: mem_reliable: Alloc task memory from reliable region +- mm: mem_reliable: Introduce memory reliable +- efi: Disable mirror feature during crashkernel +- proc: introduce proc_hide_ents to hide proc files +- !3935 pid_ns: Make pid_max per namespace +- pid_ns: Make pid_max per namespace +- !3913 arm64: Add non nmi ipi backtrace support +- arm64: Add non nmi ipi backtrace support +- !3785 【OLK-6.6】PSI cgroupv1 and PSI fine grained +- sched/psi: enable PSI_CGROUP_V1 and PSI_FINE_GRAINED in openeuler_defconfig +- sched/psi: add cpu fine grained stall tracking in pressure.stat +- sched/psi: add more memory fine grained stall tracking in pressure.stat +- sched/psi: Introduce pressure.stat in psi +- sched/psi: Introduce avgs and total calculation for cgroup reclaim +- sched/psi: Introduce fine grained stall time collect for cgroup reclaim +- sched/psi: introduce tracepoints for psi_memstall_{enter, leave} +- sched/psi: update psi irqtime when the irq delta is nozero +- sched/psi: Export cgroup psi from cgroupv2 to cgroupv1 +- sched/psi: Bail out early from irq time accounting +- !3907 cgroup: Support iocost for cgroup v1 +- openeuler_defconfig: enable iocost in openeuler_defconfig for x86 and arm64 +- cgroup: Support iocost for cgroup v1 +- !3897 Some simple extensions of the kfence feature +- arm64: kfence: scale sample_interval to support early init for kfence. +- kfence: Add a module parameter to adjust kfence objects +- !3888 fs/dcache.c: avoid panic while lockref of dentry overflow +- fs/dcache.c: avoid panic while lockref of dentry overflow +- !3894 Add swap control for memcg +- config: enable memcg swap qos for x86_64 and arm64 by default +- memcg/swap: add ability to disable memcg swap +- mm: swap_slots: add per-type slot cache +- mm/swapfile: introduce per-memcg swapfile control +- memcg: add restrict to swap to cgroup1 +- memcg: introduce per-memcg swapin interface +- memcg: introduce memcg swap qos feature +- memcg: make sysctl registration more extensible +- memcg: add page type to memory.reclaim interface +- !3827 backport mainline md patch +- dm-raid: delay flushing event_work() after reconfig_mutex is released +- md/raid1: support read error check +- md: factor out a helper exceed_read_errors() to check read_errors +- md: Whenassemble the array, consult the superblock of the freshest device +- md/raid1: remove unnecessary null checking +- md: split MD_RECOVERY_NEEDED out of mddev_resume +- md: fix stopping sync thread +- md: fix missing flush of sync_work +- md: synchronize flush io with array reconfiguration +- md/md-multipath: remove rcu protection to access rdev from conf +- md/raid5: remove rcu protection to access rdev from conf +- md/raid1: remove rcu protection to access rdev from conf +- md/raid10: remove rcu protection to access rdev from conf +- md: remove flag RemoveSynchronized +- Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d" +- md: bypass block throttle for superblock update +- md: cleanup pers->prepare_suspend() +- md-cluster: check for timeout while a new disk adding +- md: rename __mddev_suspend/resume() back to mddev_suspend/resume() +- md: remove old apis to suspend the array +- md: suspend array in md_start_sync() if array need reconfiguration +- md/raid5: replace suspend with quiesce() callback +- md/md-linear: cleanup linear_add() +- md: cleanup mddev_create/destroy_serial_pool() +- md: use new apis to suspend array before mddev_create/destroy_serial_pool +- md: use new apis to suspend array for ioctls involed array reconfiguration +- md: use new apis to suspend array for adding/removing rdev from state_store() +- md: use new apis to suspend array for sysfs apis +- md/raid5: use new apis to suspend array +- md/raid5-cache: use new apis to suspend array +- md/md-bitmap: use new apis to suspend array for location_store() +- md/dm-raid: use new apis to suspend array +- md: add new helpers to suspend/resume and lock/unlock array +- md: add new helpers to suspend/resume array +- md: replace is_md_suspended() with 'mddev->suspended' in md_check_recovery() +- md/raid5-cache: use READ_ONCE/WRITE_ONCE for 'conf->log' +- md: use READ_ONCE/WRITE_ONCE for 'suspend_lo' and 'suspend_hi' +- md/raid1: don't split discard io for write behind +- md: do not require mddev_lock() for all options in array_state_store() +- md: simplify md_seq_ops +- md: factor out a helper from mddev_put() +- md: replace deprecated strncpy with memcpy +- md: don't check 'mddev->pers' and 'pers->quiesce' from suspend_lo_store() +- md: don't check 'mddev->pers' from suspend_hi_store() +- md-bitmap: suspend array earlier in location_store() +- md-bitmap: remove the checking of 'pers->quiesce' from location_store() +- md: initialize 'writes_pending' while allocating mddev +- md: initialize 'active_io' while allocating mddev +- md: delay remove_and_add_spares() for read only array to md_start_sync() +- md: factor out a helper rdev_addable() from remove_and_add_spares() +- md: factor out a helper rdev_is_spare() from remove_and_add_spares() +- md: factor out a helper rdev_removeable() from remove_and_add_spares() +- md: delay choosing sync action to md_start_sync() +- md: factor out a helper to choose sync action from md_check_recovery() +- md: use separate work_struct for md_start_sync() +- !3857 scsi: fix use-after-free problem in scsi_remove_target +- scsi: fix use-after-free problem in scsi_remove_target +- !3906 sched/core: Change depends of SCHED_CORE +- sched/core: Change depends of SCHED_CORE +- !3747 Introduce multiple qos level +- config: Enable CONFIG_QOS_SCHED_MULTILEVEL +- sched/fair: Introduce multiple qos level +- !3899 fs/dirty_pages: dump the number of dirty pages for each inode +- fs/dirty_pages: dump the number of dirty pages for each inode +- !3815 JFFS2: Fix the race issues caused by the GC of jffs2 +- jffs2: reset pino_nlink to 0 when inode creation failed +- jffs2: make the overwritten xattr invisible after remount +- jffs2: handle INO_STATE_CLEARING in jffs2_do_read_inode() +- jffs2: protect no-raw-node-ref check of inocache by erase_completion_lock +- !3891 block: support to account io_ticks precisely +- block: support to account io_ticks precisely +- !3881 iommu: set CONFIG_SMMU_BYPASS_DEV=y +- iommu: set CONFIG_SMMU_BYPASS_DEV=y +- !3819 support ext3/ext4 netlink error report. +- Add new config 'CONFIG_EXT4_ERROR_REPORT' to control ext3/4 error reporting +- ext4: report error to userspace by netlink +- !3720 blk-mq: make fair tag sharing configurable +- scsi_lib: disable fair tag sharing by default if total tags is less than 128 +- scsi: core: make fair tag sharing configurable via sysfs +- blk-mq: add apis to disable fair tag sharing +- !3090 fs/dcache.c: avoid softlock since too many negative dentry +- fs/dcache.c: avoid softlock since too many negative dentry +- !3656 iommu: Enable smmu-v3 when 3408iMR/3416iMRraid card exist +- iommu: Enable smmu-v3 when 3408iMR/3416iMRraid card exist +- !3843 [OLK-6.6] export cgroup.stat from cgroupv2 to cgroupv1 +- cgroup: Export cgroup.stat from cgroupv2 to cgroupv1 +- !3828 openeuler_defconfig: enable erofs ondemand for x86 and arm64 +- openeuler_defconfig: enable erofs ondemand for x86 and arm64 +- !3851 ext4: fix slab-out-of-bounds in ext4_find_extent() +- ext4: check magic even the extent block bh is verified +- ext4: avoid recheck extent for EXT4_EX_FORCE_CACHE +- !3850 aio: add timeout validity check for io_[p +- aio: add timeout validity check for io_[p]getevents +- !3849 pipe: Fix endless sleep problem due to the out-of-order +- pipe: Fix endless sleep problem due to the out-of-order +- !3787 scsi: sd: unregister device if device_add_disk() failed in sd_probe() +- scsi: sd: unregister device if device_add_disk() failed in sd_probe() +- !3450 Backport nbd bugfix patch +- nbd: pass nbd_sock to nbd_read_reply() instead of index +- nbd: fix null-ptr-dereference while accessing 'nbd->config' +- nbd: factor out a helper to get nbd_config without holding 'config_lock' +- nbd: fold nbd config initialization into nbd_alloc_config() +- !3675 block mainline bugfix backport +- block: Set memalloc_noio to false on device_add_disk() error path +- block: add check of 'minors' and 'first_minor' in device_add_disk() +- block: add check that partition length needs to be aligned with block size +- !3786 ubi: block: fix memleak in ubiblock_create() +- ubi: block: fix memleak in ubiblock_create() +- !3448 ubi: block: Fix use-after-free in ubiblock_cleanup +- ubi: block: Fix use-after-free in ubiblock_cleanup +- !3760 Add huge page allocation limit +- openeuler_defconfig: enable HUGETLB_ALLOC_LIMIT +- hugetlb: Add huge page allocation limit +- !3818 [sync] PR-1989: support Android vendor hooks +- openeuler_defconfig: enable CONFIG_VENDOR_HOOKS for x86 and arm64 +- vendor_hooks: make android vendor hooks feature generic. +- ANDROID: fixup restricted hooks after tracepont refactoring +- ANDROID: simplify vendor hooks for non-GKI builds +- ANDROID: vendor_hooks: fix __section macro +- ANDROID: use static_call() for restricted hooks +- ANDROID: fix redefinition error for restricted vendor hooks +- ANDROID: add support for vendor hooks +- !3502 ARM: LPAE: Use phys_addr_t instead of unsigned long in outercache hooks +- ARM: LPAE: Use phys_addr_t instead of unsigned long in outercache hooks +- !3755 livepatch/core: Fix miss disable ro for MOD_RO_AFTER_INIT memory +- livepatch/core: Fix miss disable ro for MOD_RO_AFTER_INIT memory +- !3813 kernel: add OPENEULER_VERSION_CODE to version.h +- kernel: add OPENEULER_VERSION_CODE to version.h +- !3744 Add NUMA-awareness to qspinlock +- config: Enable CONFIG_NUMA_AWARE_SPINLOCKS on x86 +- locking/qspinlock: Disable CNA by default +- locking/qspinlock: Introduce the shuffle reduction optimization into CNA +- locking/qspinlock: Avoid moving certain threads between waiting queues in CNA +- locking/qspinlock: Introduce starvation avoidance into CNA +- locking/qspinlock: Introduce CNA into the slow path of qspinlock +- locking/qspinlock: Refactor the qspinlock slow path +- locking/qspinlock: Rename mcs lock/unlock macros and make them more generic +- !3517 support CLOCKSOURCE_VALIDATE_LAST_CYCLE on +- config: make CLOCKSOURCE_VALIDATE_LAST_CYCLE not set by default +- timekeeping: Make CLOCKSOURCE_VALIDATE_LAST_CYCLE configurable +- !3710 Backport 6.6.7 LTS Patches +- drm/amdgpu: Restrict extended wait to PSP v13.0.6 +- drm/amdgpu: update retry times for psp BL wait +- drm/amdgpu: Fix refclk reporting for SMU v13.0.6 +- riscv: Kconfig: Add select ARM_AMBA to SOC_STARFIVE +- gcc-plugins: randstruct: Update code comment in relayout_struct() +- ASoC: qcom: sc8280xp: Limit speaker digital volumes +- netfilter: nft_set_pipapo: skip inactive elements during set walk +- MIPS: Loongson64: Enable DMA noncoherent support +- MIPS: Loongson64: Handle more memory types passed from firmware +- MIPS: Loongson64: Reserve vgabios memory on boot +- perf metrics: Avoid segv if default metricgroup isn't set +- perf list: Fix JSON segfault by setting the used skip_duplicate_pmus callback +- KVM: SVM: Update EFER software model on CR0 trap for SEV-ES +- KVM: s390/mm: Properly reset no-dat +- MIPS: kernel: Clear FPU states when setting up kernel threads +- cifs: Fix flushing, invalidation and file size with FICLONE +- cifs: Fix flushing, invalidation and file size with copy_file_range() +- USB: gadget: core: adjust uevent timing on gadget unbind +- powerpc/ftrace: Fix stack teardown in ftrace_no_trace +- x86/CPU/AMD: Check vendor in the AMD microcode callback +- devcoredump: Send uevent once devcd is ready +- serial: 8250_omap: Add earlycon support for the AM654 UART controller +- serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt +- serial: 8250: 8250_omap: Clear UART_HAS_RHR_IT_DIS bit +- serial: sc16is7xx: address RX timeout interrupt errata +- ARM: PL011: Fix DMA support +- usb: typec: class: fix typec_altmode_put_partner to put plugs +- smb: client: fix potential NULL deref in parse_dfs_referrals() +- Revert "xhci: Loosen RPM as default policy to cover for AMD xHC 1.1" +- cifs: Fix non-availability of dedup breaking generic/304 +- parport: Add support for Brainboxes IX/UC/PX parallel cards +- serial: ma35d1: Validate console index before assignment +- serial: 8250_dw: Add ACPI ID for Granite Rapids-D UART +- nvmem: Do not expect fixed layouts to grab a layout driver +- usb: gadget: f_hid: fix report descriptor allocation +- kprobes: consistent rcu api usage for kretprobe holder +- ASoC: ops: add correct range check for limiting volume +- gpiolib: sysfs: Fix error handling on failed export +- x86/sev: Fix kernel crash due to late update to read-only ghcb_version +- perf: Fix perf_event_validate_size() +- drm/amdgpu: disable MCBP by default +- arm64: dts: mt8183: kukui: Fix underscores in node names +- arm64: dts: mediatek: add missing space before { +- parisc: Fix asm operand number out of range build error in bug table +- parisc: Reduce size of the bug_table on 64-bit kernel by half +- LoongArch: BPF: Don't sign extend function return value +- LoongArch: BPF: Don't sign extend memory load operand +- perf vendor events arm64: AmpereOne: Add missing DefaultMetricgroupName fields +- misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write +- misc: mei: client.c: return negative error code in mei_cl_write +- coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base +- coresight: ultrasoc-smb: Config SMB buffer before register sink +- coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb +- hwtracing: hisi_ptt: Add dummy callback pmu::read() +- coresight: Fix crash when Perf and sysfs modes are used concurrently +- coresight: etm4x: Remove bogous __exit annotation for some functions +- arm64: dts: mediatek: mt8186: Change gpu speedbin nvmem cell name +- arm64: dts: mediatek: mt8186: fix clock names for power domains +- arm64: dts: mediatek: mt8183-evb: Fix unit_address_vs_reg warning on ntc +- arm64: dts: mediatek: mt8183: Move thermal-zones to the root node +- arm64: dts: mediatek: mt8183: Fix unit address for scp reserved memory +- arm64: dts: mediatek: mt8195: Fix PM suspend/resume with venc clocks +- arm64: dts: mediatek: mt8173-evb: Fix regulator-fixed node names +- arm64: dts: mediatek: cherry: Fix interrupt cells for MT6360 on I2C7 +- arm64: dts: mediatek: mt8183-kukui-jacuzzi: fix dsi unnecessary cells properties +- arm64: dts: mediatek: mt7622: fix memory node warning check +- arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization +- arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3 +- arm64: dts: mt7986: change cooling trips +- drm/i915: Skip some timing checks on BXT/GLK DSI transcoders +- drm/i915/mst: Reject modes that require the bigjoiner +- drm/i915/mst: Fix .mode_valid_ctx() return values +- drm/atomic-helpers: Invoke end_fb_access while owning plane state +- md/raid6: use valid sector values to determine if an I/O should wait on the reshape +- powercap: DTPM: Fix missing cpufreq_cpu_put() calls +- mm/memory_hotplug: fix error handling in add_memory_resource() +- mm: fix oops when filemap_map_pmd() without prealloc_pte +- mm/memory_hotplug: add missing mem_hotplug_lock +- drivers/base/cpu: crash data showing should depends on KEXEC_CORE +- hugetlb: fix null-ptr-deref in hugetlb_vma_lock_write +- workqueue: Make sure that wq_unbound_cpumask is never empty +- platform/surface: aggregator: fix recv_buf() return value +- regmap: fix bogus error on regcache_sync success +- r8169: fix rtl8125b PAUSE frames blasting when suspended +- packet: Move reference count in packet_sock to atomic_long_t +- nfp: flower: fix for take a mutex lock in soft irq context and rcu lock +- leds: trigger: netdev: fix RTNL handling to prevent potential deadlock +- tracing: Fix a possible race when disabling buffered events +- tracing: Fix incomplete locking when disabling buffered events +- tracing: Disable snapshot buffer when stopping instance tracers +- tracing: Stop current tracer when resizing buffer +- tracing: Always update snapshot buffer size +- checkstack: fix printed address +- cgroup_freezer: cgroup_freezing: Check if not frozen +- lib/group_cpus.c: avoid acquiring cpu hotplug lock in group_cpus_evenly +- nilfs2: prevent WARNING in nilfs_sufile_set_segment_usage() +- nilfs2: fix missing error check for sb_set_blocksize call +- highmem: fix a memory copy problem in memcpy_from_folio +- ring-buffer: Force absolute timestamp on discard of event +- ring-buffer: Test last update in 32bit version of __rb_time_read() +- ALSA: hda/realtek: Add quirk for Lenovo Yoga Pro 7 +- ALSA: hda/realtek: Add Framework laptop 16 to quirks +- ALSA: hda/realtek: add new Framework laptop to quirks +- ALSA: hda/realtek: Enable headset on Lenovo M90 Gen5 +- ALSA: hda/realtek: fix speakers on XPS 9530 (2023) +- ALSA: hda/realtek: Apply quirk for ASUS UM3504DA +- ALSA: pcm: fix out-of-bounds in snd_pcm_state_names +- ALSA: usb-audio: Add Pioneer DJM-450 mixer controls +- io_uring: fix mutex_unlock with unreferenced ctx +- nvme-pci: Add sleep quirk for Kingston drives +- io_uring/af_unix: disable sending io_uring over sockets +- ASoC: amd: yc: Fix non-functional mic on ASUS E1504FA +- rethook: Use __rcu pointer for rethook::handler +- scripts/gdb: fix lx-device-list-bus and lx-device-list-class +- kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP +- md: don't leave 'MD_RECOVERY_FROZEN' in error path of md_set_readonly() +- riscv: errata: andes: Probe for IOCP only once in boot stage +- riscv: fix misaligned access handling of C.SWSP and C.SDSP +- arm64: dts: rockchip: Fix eMMC Data Strobe PD on rk3588 +- ARM: dts: imx28-xea: Pass the 'model' property +- ARM: dts: imx7: Declare timers compatible with fsl,imx6dl-gpt +- arm64: dts: imx8-apalis: set wifi regulator to always-on +- ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init +- arm64: dts: imx93: correct mediamix power +- arm64: dts: freescale: imx8-ss-lsio: Fix #pwm-cells +- arm64: dts: imx8-ss-lsio: Add PWM interrupts +- scsi: be2iscsi: Fix a memleak in beiscsi_init_wrb_handle() +- tracing: Fix a warning when allocating buffered events fails +- io_uring/kbuf: check for buffer list readiness after NULL check +- io_uring/kbuf: Fix an NULL vs IS_ERR() bug in io_alloc_pbuf_ring() +- ARM: dts: imx6ul-pico: Describe the Ethernet PHY clock +- arm64: dts: imx8mp: imx8mq: Add parkmode-disable-ss-quirk on DWC3 +- drm/bridge: tc358768: select CONFIG_VIDEOMODE_HELPERS +- RDMA/irdma: Avoid free the non-cqp_request scratch +- RDMA/irdma: Fix support for 64k pages +- RDMA/irdma: Ensure iWarp QP queue memory is OS paged aligned +- RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz +- ASoC: wm_adsp: fix memleak in wm_adsp_buffer_populate +- firmware: arm_scmi: Fix possible frequency truncation when using level indexing mode +- firmware: arm_scmi: Simplify error path in scmi_dvfs_device_opps_add() +- firmware: arm_scmi: Fix frequency truncation by promoting multiplier type +- firmware: arm_scmi: Extend perf protocol ops to get information of a domain +- firmware: arm_scmi: Extend perf protocol ops to get number of domains +- hwmon: (nzxt-kraken2) Fix error handling path in kraken2_probe() +- ASoC: codecs: lpass-tx-macro: set active_decimator correct default value +- hwmon: (acpi_power_meter) Fix 4.29 MW bug +- ARM: dts: bcm2711-rpi-400: Fix delete-node of led_act +- ARM: dts: rockchip: Fix sdmmc_pwren's pinmux setting for RK3128 +- ARM: dts: imx6q: skov: fix ethernet clock regression +- arm64: dt: imx93: tqma9352-mba93xxla: Fix LPUART2 pad config +- RDMA/irdma: Fix UAF in irdma_sc_ccq_get_cqe_info() +- RDMA/bnxt_re: Correct module description string +- RDMA/rtrs-clt: Remove the warnings for req in_use check +- RDMA/rtrs-clt: Fix the max_send_wr setting +- RDMA/rtrs-srv: Destroy path files after making sure no IOs in-flight +- RDMA/rtrs-srv: Free srv_mr iu only when always_invalidate is true +- RDMA/rtrs-srv: Check return values while processing info request +- RDMA/rtrs-clt: Start hb after path_up +- RDMA/rtrs-srv: Do not unconditionally enable irq +- ASoC: fsl_sai: Fix no frame sync clock issue on i.MX8MP +- arm64: dts: rockchip: Expand reg size of vdec node for RK3399 +- arm64: dts: rockchip: Expand reg size of vdec node for RK3328 +- RDMA/irdma: Add wait for suspend on SQD +- RDMA/irdma: Do not modify to SQD on error +- RDMA/hns: Fix unnecessary err return when using invalid congest control algorithm +- RDMA/core: Fix uninit-value access in ib_get_eth_speed() +- tee: optee: Fix supplicant based device enumeration +- mm/damon/sysfs: eliminate potential uninitialized variable warning +- drm/amdkfd: get doorbell's absolute offset based on the db_size +- drm/amd/amdgpu/amdgpu_doorbell_mgr: Correct misdocumented param 'doorbell_index' +- net/smc: fix missing byte order conversion in CLC handshake +- net: dsa: microchip: provide a list of valid protocols for xmit handler +- drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group +- psample: Require 'CAP_NET_ADMIN' when joining "packets" group +- bpf: sockmap, updating the sg structure should also update curr +- net: tls, update curr on splice as well +- net: dsa: mv88e6xxx: Restore USXGMII support for 6393X +- tcp: do not accept ACK of bytes we never sent +- netfilter: xt_owner: Fix for unsafe access of sk->sk_socket +- netfilter: nf_tables: validate family when identifying table via handle +- netfilter: nf_tables: bail out on mismatching dynset and set expressions +- netfilter: nf_tables: fix 'exist' matching on bigendian arches +- netfilter: bpf: fix bad registration on nf_defrag +- dt-bindings: interrupt-controller: Allow #power-domain-cells +- octeontx2-af: Update Tx link register range +- octeontx2-af: Add missing mcs flr handler call +- octeontx2-af: Fix mcs stats register address +- octeontx2-af: Fix mcs sa cam entries size +- octeontx2-af: Adjust Tx credits when MCS external bypass is disabled +- net: hns: fix fake link up on xge port +- net: hns: fix wrong head when modify the tx feature when sending packets +- net: atlantic: Fix NULL dereference of skb pointer in +- ipv4: ip_gre: Avoid skb_pull() failure in ipgre_xmit() +- ionic: Fix dim work handling in split interrupt mode +- ionic: fix snprintf format length warning +- tcp: fix mid stream window clamp. +- net: bnxt: fix a potential use-after-free in bnxt_init_tc +- iavf: validate tx_coalesce_usecs even if rx_coalesce_usecs is zero +- i40e: Fix unexpected MFS warning message +- ice: Restore fix disabling RX VLAN filtering +- octeontx2-af: fix a use-after-free in rvu_npa_register_reporters +- xsk: Skip polling event check for unbound socket +- net: stmmac: fix FPE events losing +- octeontx2-pf: consider both Rx and Tx packet stats for adaptive interrupt coalescing +- arcnet: restoring support for multiple Sohard Arcnet cards +- platform/mellanox: Check devm_hwmon_device_register_with_groups() return value +- platform/mellanox: Add null pointer checks for devm_kasprintf() +- mlxbf-bootctl: correctly identify secure boot with development keys +- r8152: Add RTL8152_INACCESSIBLE to r8153_aldps_en() +- r8152: Add RTL8152_INACCESSIBLE to r8153_pre_firmware_1() +- r8152: Add RTL8152_INACCESSIBLE to r8156b_wait_loading_flash() +- r8152: Add RTL8152_INACCESSIBLE checks to more loops +- r8152: Hold the rtnl_lock for all of reset +- hv_netvsc: rndis_filter needs to select NLS +- bpf: Fix a verifier bug due to incorrect branch offset comparison with cpu=v4 +- octeontx2-af: Check return value of nix_get_nixlf before using nixlf +- octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam +- ipv6: fix potential NULL deref in fib6_add() +- platform/x86: wmi: Skip blocks with zero instances +- of: dynamic: Fix of_reconfig_get_state_change() return value documentation +- platform/x86: asus-wmi: Move i8042 filter install to shared asus-wmi code +- dt: dt-extract-compatibles: Don't follow symlinks when walking tree +- dt: dt-extract-compatibles: Handle cfile arguments in generator function +- x86/tdx: Allow 32-bit emulation by default +- x86/entry: Do not allow external 0x80 interrupts +- x86/entry: Convert INT 0x80 emulation to IDTENTRY +- x86/coco: Disable 32-bit emulation by default on TDX and SEV +- x86: Introduce ia32_enabled() +- dm-crypt: start allocating with MAX_ORDER +- drm/amdgpu: correct chunk_ptr to a pointer to chunk. +- drm/amdgpu: finalizing mem_partitions at the end of GMC v9 sw_fini +- drm/amdgpu: Do not program VF copy regs in mmhub v1.8 under SRIOV (v2) +- kconfig: fix memory leak from range properties +- modpost: fix section mismatch message for RELA +- tg3: Increment tx_dropped in tg3_tso_bug() +- tg3: Move the [rt]x_dropped counters to tg3_napi +- zstd: Fix array-index-out-of-bounds UBSAN warning +- nouveau: use an rwlock for the event lock. +- netfilter: ipset: fix race condition between swap/destroy and kernel side add/del/test +- i2c: ocores: Move system PM hooks to the NOIRQ phase +- i2c: designware: Fix corrupted memory seen in the ISR +- hrtimers: Push pending hrtimers away from outgoing CPU earlier +- scsi: sd: Fix sshdr use in sd_suspend_common() +- vdpa/mlx5: preserve CVQ vringh index +- !3749 support nokaslr and memmap parameter for kaslr collision detection +- kaslr: enable CONFIG_SKIP_KASLR_MEM_RANGE in openeuler defconfig +- x86/boot: add x86 nokaslr memory regions +- efi/libstub: add arm64 nokaslr memory regions +- efi/libstub: arm64: Fix KASLR and memmap= collision +- efi/libstub: arm64: support strchr function for EFI stub +- efi/libstub: add arm64 kaslr memory region avoid support +- !3737 arm64: Fix compilation error with ILP32 +- config: Disable CONFIG_COMPAT_BINFMT_ELF as default +- arm64: Fix compilation error with ILP32 support +- Revert "Kconfig: regularize selection of CONFIG_BINFMT_ELF" +- !3743 Fix ppc32 build error +- powerpc: Fix ppc32 build +- !3713 Introduce CPU inspect feature +- openeuler_defconfig: enable CPU inspect for arm64 by default +- cpuinspect: add ATF inspector +- cpuinspect: add CPU-inspect infrastructure +- !3730 ARM: spectre-v2: turn off the mitigation via boot cmdline param +- ARM: spectre-v2: turn off the mitigation via boot cmdline param +- !3732 tcp_comp: implement tcp compression +- tcp_comp: implement tcp compression +- !3748 jffs2: move jffs2_init_inode_info() just after allocating inode +- jffs2: move jffs2_init_inode_info() just after allocating inode +- !3542 Support kernel livepatching +- livepatch/powerpc: Add arch_klp_module_check_calltrace +- livepatch/powerpc: Support breakpoint exception optimization +- livepatch/ppc64: Sample testcase fix ppc64 +- livepatch/ppc64: Implement livepatch without ftrace for ppc64be +- livepatch: Bypass dead thread when check calltrace +- livepatch/arm: Add arch_klp_module_check_calltrace +- livepatch/arm64: Add arch_klp_module_check_calltrace +- livepatch/x86: Add arch_klp_module_check_calltrace +- livepatch: Add klp_module_delete_safety_check +- livepatch/arm: Support breakpoint exception optimization +- livepatch/arm64: Support breakpoint exception optimization +- livepatch: Add arch_klp_init +- livepatch/x86: Support breakpoint exception optimization +- livepatch: Use breakpoint exception to optimize enabling livepatch +- livepatch/ppc32: Support livepatch without ftrace +- livepatch/arm: Support livepatch without ftrace +- livepatch/core: Add support for arm for klp relocation +- arm/module: Use plt section indices for relocations +- livepatch: Enable livepatch configs in openeuler_defconfig +- livepatch/core: Revert module_enable_ro and module_disable_ro +- livepatch/arm64: Support livepatch without ftrace +- livepatch/core: Avoid conflict with static {call,key} +- livepatch: Fix patching functions which have static_call +- livepatch: Fix crash when access the global variable in hook +- livepatch/core: Support jump_label +- livepatch: samples: Adapt livepatch-sample for solution without ftrace +- livepatch/core: Support load and unload hooks +- livepatch/core: Restrict livepatch patched/unpatched when plant kprobe +- livepatch/core: Disable support for replacing +- livepatch/x86: Support livepatch without ftrace +- Revert "x86/insn: Make insn_complete() static" +- livepatch/core: Reuse common codes in the solution without ftrace +- livepatch/core: Allow implementation without ftrace +- !3678 timer_list: avoid other cpu soft lockup when printing timer list +- timer_list: avoid other cpu soft lockup when printing timer list +- !3733 drm/radeon: check the alloc_workqueue return value in radeon_crtc_init() +- drm/radeon: check the alloc_workqueue return value in radeon_crtc_init() +- !3734 Introduce qos smt expeller for co-location +- sched/fair: Add cmdline nosmtexpell +- sched/fair: Introduce QOS_SMT_EXPELL priority reversion mechanism +- sched/fair: Start tracking qos_offline tasks count in cfs_rq +- config: Enable CONFIG_QOS_SCHED_SMT_EXPELLER +- sched: Add tracepoint for qos smt expeller +- sched: Add statistics for qos smt expeller +- sched: Implement the function of qos smt expeller +- sched: Introduce qos smt expeller for co-location +- !3629 x86/kdump: make crash kernel boot faster +- x86/kdump: make crash kernel boot faster +- !3722 add memmap interface to reserved memory +- arm64: Request resources for reserved memory via memmap +- arm64: Add support for memmap kernel parameters +- !3724 lib/clear_user: ensure loop in __arch_clear_user cache-aligned v2 +- config: enable CONFIG_CLEAR_USER_WORKAROUND by default +- lib/clear_user: ensure loop in __arch_clear_user cache-aligned v2 +- !3688 Support priority load balance for qos scheduler +- sched: Introduce priority load balance for qos scheduler +- !3712 sched: steal tasks to improve CPU utilization +- config: enable CONFIG_SCHED_STEAL by default +- sched/fair: introduce SCHED_STEAL +- disable stealing by default +- sched/fair: Provide idle search schedstats +- sched/fair: disable stealing if too many NUMA nodes +- sched/fair: Steal work from an overloaded CPU when CPU goes idle +- sched/fair: Provide can_migrate_task_llc +- sched/fair: Generalize the detach_task interface +- sched/fair: Hoist idle_stamp up from idle_balance +- sched/fair: Dynamically update cfs_overload_cpus +- sched/topology: Provide cfs_overload_cpus bitmap +- sched/topology: Provide hooks to allocate data shared per LLC +- sched: Provide sparsemask, a reduced contention bitmap +- !3701 mm: Add sysctl to clear free list pages +- mm: Add sysctl to clear free list pages +- !3598 arm64: add config switch and kernel parameter for cpu0 hotplug +- config: disable config ARM64_BOOTPARAM_HOTPLUG_CPU0 by default +- arm64: Add config switch and kernel parameter for CPU0 hotplug +- !3649 x86/kdump: add log before booting crash kernel +- x86/kdump: add log before booting crash kernel +- !3700 Backport 6.6.6 LTS Patches +- Revert "wifi: cfg80211: fix CQM for non-range use" +- !3565 blk-throttle: enable hierarchical throttle in cgroup v1 +- blk-throttle: enable hierarchical throttle in cgroup v1 +- !3608 xfs: fix two corruption problems +- xfs: shutdown xfs once inode double free +- xfs: shutdown to ensure submits buffers on LSN boundaries +- !3674 mm/hugetlb: Introduce alloc_hugetlb_folio_size() +- mm/hugetlb: Introduce alloc_hugetlb_folio_size() +- !3651 nbd: get config_lock before sock_shutdown +- nbd: get config_lock before sock_shutdown +- !3573 Support dynamic affinity scheduler +- sched/fair: Modify idle cpu judgment in dynamic affinity +- sched/fair: Remove invalid cpu selection logic in dynamic affinity +- config: enable CONFIG_QOS_SCHED_DYNAMIC_AFFINITY by default +- sched: Add cmdline for dynamic affinity +- sched: Add statistics for scheduler dynamic affinity +- sched: Adjust cpu allowed in load balance dynamicly +- sched: Adjust wakeup cpu range according CPU util dynamicly +- cpuset: Introduce new interface for scheduler dynamic affinity +- sched: Introduce dynamic affinity for cfs scheduler +- !3599 arm64: Add framework to turn IPI as NMI +- arm64: kgdb: Roundup cpus using IPI as NMI +- kgdb: Expose default CPUs roundup fallback mechanism +- arm64: ipi_nmi: Add support for NMI backtrace +- nmi: backtrace: Allow runtime arch specific override +- arm64: smp: Assign and setup an IPI as NMI +- irqchip/gic-v3: Enable support for SGIs to act as NMIs +- arm64: Add framework to turn IPI as NMI +- !3638 memcg: support OOM priority for memcg +- memcg: enable CONFIG_MEMCG_OOM_PRIORITY by default +- memcg: Add sysctl memcg_qos_enable +- memcg: support priority for oom +- !3602 xfs: fix attr inactive problems +- xfs: atomic drop extent entries when inactiving attr +- xfs: factor out __xfs_da3_node_read() +- xfs: force shutdown xfs when xfs_attr_inactive fails +- !3601 xfs: fix perag leak when growfs fails +- xfs: fix perag leak when growfs fails +- xfs: add lock protection when remove perag from radix tree +- !3575 ubi: Enhance fault injection capability for the UBI driver +- mtd: Add several functions to the fail_function list +- ubi: Reserve sufficient buffer length for the input mask +- ubi: Add six fault injection type for testing +- ubi: Split io_failures into write_failure and erase_failure +- ubi: Use the fault injection framework to enhance the fault injection capability +- !3588 files cgroups +- enable CONFIG_CGROUP_FILES in openeuler_defconfig for x86 and arm64 +- cgroup/files: support boot parameter to control if disable files cgroup +- fs/filescontrol: add a switch to enable / disable accounting of open fds +- cgroups: Resource controller for open files +- !3605 openeuler_defconfig: enable CONFIG_UNICODE for x86 and arm64 +- openeuler_defconfig: enable CONFIG_UNICODE for x86 and arm64 +- !3600 iommu/arm-smmu-v3: Add a SYNC command to avoid broken page table prefetch +- iommu/arm-smmu-v3: Add a SYNC command to avoid broken page table prefetch +- !3397 xfs: fix some growfs problems +- xfs: fix dir3 block read verify fail during log recover +- xfs: keep growfs sb log item active until ail flush success +- xfs: fix mounting failed caused by sequencing problem in the log records +- xfs: fix the problem of mount failure caused by not refreshing mp->m_sb +- !3582 Add support for memory limit +- mm: support pagecache limit +- mm: support periodical memory reclaim +- !3323 LoongArch: add cpufreq and ls2k500 bmc support +- LoongArch: fix ls2k500 bmc not work when installing iso +- LoongArch: defconfig: enable CONFIG_FB_LS2K500=m. +- ipmi: add ls2k500 bmc ipmi support. +- fbdev: add ls2k500sfb driver for ls2k500 bmc. +- cpufreq: Add cpufreq driver for LoongArch +- !3363 xfs: fix some misc issue +- xfs: xfs_trans_cancel() path must check for log shutdown +- xfs: don't verify agf length when log recovery +- xfs: fix a UAF in xfs_iflush_abort_clean +- xfs: fix a UAF when inode item push +- !3495 xfs: fix hung and warning +- xfs: fix warning in xfs_vm_writepages() +- xfs: fix hung when transaction commit fail in xfs_inactive_ifree +- xfs: fix dead loop when do mount with IO fault injection +- !3525 ARM: support kaslr feature in arm32 platform +- arm32: kaslr: Fix clock_gettime and gettimeofday performance degradation when configure CONFIG_RANDOMIZE_BASE +- arm32: kaslr: Fix the bug of symbols relocation +- arm32: kaslr: print kaslr offset when kernel panic +- arm32: kaslr: pop visibility when compile decompress boot code as we need relocate BSS by GOT. +- arm32: kaslr: When boot with vxboot, we must adjust dtb address before kaslr_early_init, and store dtb address after init. +- No idea why this broke ... +- ARM: decompressor: add KASLR support +- ARM: decompressor: explicitly map decompressor binary cacheable +- ARM: kernel: implement randomization of the kernel load address +- arm: vectors: use local symbol names for vector entry points +- ARM: kernel: refer to swapper_pg_dir via its symbol +- ARM: mm: export default vmalloc base address +- ARM: kernel: use PC relative symbol references in suspend/resume code +- ARM: kernel: use PC-relative symbol references in MMU switch code +- ARM: kernel: make vmlinux buildable as a PIE executable +- ARM: kernel: switch to relative exception tables +- arm-soc: various: replace open coded VA->PA calculation of pen_release +- arm-soc: mvebu: replace open coded VA->PA conversion +- arm-soc: exynos: replace open coded VA->PA conversions +- asm-generic: add .data.rel.ro sections to __ro_after_init +- !3563 memcg: support ksm merge any mode per cgroup +- memcg: support ksm merge any mode per cgroup +- !3528 Print rootfs and tmpfs files charged by memcg +- config: enable CONFIG_MEMCG_MEMFS_INFO by default +- mm/memcg_memfs_info: show files that having pages charged in mem_cgroup +- fs: move {lock, unlock}_mount_hash to fs/mount.h +- !3489 ascend: export interfaces required by ascend drivers +- ascend: export interfaces required by ascend drivers +- !3381 cgroupv1 cgroup writeback enable +- openeuler_defconfig: enable CONFIG_CGROUP_V1_WRITEBACK in openeuler_defconfig for x86 and arm64 +- cgroup: support cgroup writeback on cgroupv1 +- cgroup: factor out __cgroup_get_from_id() for cgroup v1 +- !3537 backport cgroup bugs from olk5.10 +- cgroup: disable kernel memory accounting for all memory cgroups by default +- cgroup: Return ERSCH when add Z process into task +- cgroup: wait for cgroup destruction to complete when umount +- cgroup: check if cgroup root is alive in cgroupstats_show() +- !3439 security: restrict init parameters by configuration +- security: restrict init parameters by configuration +- !3475 kaslr: ppc64: Introduce KASLR for PPC64 +- powerpc/fsl_booke/kaslr: Fix preserved memory size for int-vectors issue +- powerpc/fsl_booke/kaslr: Provide correct r5 value for relocated kernel +- powerpc/fsl_booke/kaslr: rename kaslr-booke32.rst to kaslr-booke.rst and add 64bit part +- powerpc/fsl_booke/64: clear the original kernel if randomized +- powerpc/fsl_booke/64: do not clear the BSS for the second pass +- powerpc/fsl_booke/64: implement KASLR for fsl_booke64 +- powerpc/fsl_booke/64: introduce reloc_kernel_entry() helper +- powerpc/fsl_booke/kaslr: refactor kaslr_legal_offset() and kaslr_early_init() +- !3486 sync smmu patches for olk-6.6 +- iommu/arm-smmu-v3: disable stall for quiet_cd +- iommu/iova: Manage the depot list size +- iommu/iova: Make the rcache depot scale better +- !3434 arm64/ascend: Add new enable_oom_killer interface for oom contrl +- arm64/ascend: Add new enable_oom_killer interface for oom contrl +- !3479 cache: Workaround HiSilicon Linxicore DC CVAU +- cache: Workaround HiSilicon Linxicore DC CVAU +- !3367 ipv4: igmp: fix refcnt uaf issue when receiving igmp query packet +- ipv4: igmp: fix refcnt uaf issue when receiving igmp query packet +- !3471 add redis sockmap sample code +- tools: add sample sockmap code for redis +- net: add local_skb parameter to identify local tcp connection +- net: let sockops can use bpf_get_current_comm() +- !3432 ACPI / APEI: Notify all ras err to driver +- ACPI / APEI: Notify all ras err to driver + +* Tue Dec 26 2023 Zheng Zengkai - 6.6.0-2.0.0.2 +- !3435 iommu/arm-smmu-v3: Add suspend and resume support +- !3315 Backport 6.6.5 LTS Patches +- !3314 Backport 6.6.4 LTS Patches +- !3286 block: Add config option to not allow writing to mounted devices +- !3430 Add support for hisi HBM devices +- !3431 memcg reclaim and cgroup kill +- iommu/arm-smmu-v3: Add suspend and resume support +- config: enable CONFIG_MEMCG_V1_RECLAIM and CONFIG_CGROUP_V1_KILL +- memcg: introduce per-memcg reclaim interface +- memcg: export high_async_ratio to userland +- memcg: enable memcg async reclaim +- memcg: Export memory.events{local} from cgroupv2 to cgroupv1 +- memcg: Export memcg.{min/low/high} from cgroupv2 to cgroupv1 +- cgroup: Export cgroup.kill from cgroupv2 to cgroupv1 +- soc: hisilicon: hisi_hbmdev: Add hbm acls repair and query methods +- soc: hbmcache: Add support for online and offline the hbm cache +- soc: hisilicon: hisi_hbmdev: Provide extra memory topology information +- ACPI: memhotplug: export the state of each hotplug device +- soc: hisilicon: hisi_hbmdev: Add power domain control methods +- ACPI: OSL: Export the symbol of acpi_hotplug_schedule +- !3391 nbd_genl_status: null check for nla_nest_start +- !3352 support userswap feature +- !3383 Support Qos Scheduler +- nbd_genl_status: null check for nla_nest_start +- sched: Enable qos scheduler config +- sched: Introduce handle priority reversion mechanism +- sched: Support kill boost for offline task +- sched: Throttle qos cfs_rq when current cpu is running online task +- sched: Introduce qos scheduler for co-location +- !3306 improve gettimeofday() performance in user space +- !3331 kabi: add kabi helper macros and tools +- mm/userswap: openeuler_defconfig: enable userswap +- mm/userswap: provide cpu info in userfault msg +- mm/userswap: introduce UFFDIO_COPY_MODE_DIRECT_MAP +- mm/userswap: support userswap via userfaultfd +- mm/userswap: introduce MREMAP_USWAP_SET_PTE +- mm/userswap: add enable_userswap boot option +- mm/userswap: add VM_USWAP and SWP_USERSWAP_ENTRY +- !3326 config: Open CONFIG_AARCH32_EL0 and keep CONFIG_ARM64_ILP32 closed +- kabi: add kABI reference checking tool +- kabi: add a tool to generate the kabi reference relationship +- kabi: add script tools to check kabi symbol +- kabi: deduplication friendly structs +- kabi: Generalize naming of kabi helper macros +- openeuler_defconfig: Enable CONFIG_KABI_RESERVE for x86 and arm64 +- KABI: Add CONFIG_KABI_RESERVE to control KABI padding reserve +- kabi: enables more stringent kabi checks +- kabi: add KABI_SIZE_ALIGN_CHECKS for more stringent kabi checks +- kabi: add kabi helper macros +- !3298 ARM: Add unwinding annotations to __loop.*delay functions +- config: Open CONFIG_AARCH32_EL0 and keep CONFIG_ARM64_ILP32 closed +- !3300 Add sharepool support v3 +- vfio: Drop vfio_file_iommu_group() stub to fudge around a KVM wart +- x86/xen: fix percpu vcpu_info allocation +- vfio/pds: Fix possible sleep while in atomic context +- vfio/pds: Fix mutex lock->magic != lock warning +- drm/amd/display: Fix MPCC 1DLUT programming +- drm/amd/display: Simplify brightness initialization +- drm/amd/display: Reduce default backlight min from 5 nits to 1 nits +- drm/amd/display: refactor ILR to make it work +- iommu: Fix printk arg in of_iommu_get_resv_regions() +- drm/amd/pm: fix a memleak in aldebaran_tables_init +- cpufreq/amd-pstate: Only print supported EPP values for performance governor +- cpufreq/amd-pstate: Fix scaling_min_freq and scaling_max_freq update +- drm/panel: nt36523: fix return value check in nt36523_probe() +- drm/panel: starry-2081101qfh032011-53g: Fine tune the panel power sequence +- drm/i915/gsc: Mark internal GSC engine with reserved uabi class +- iommu/vt-d: Make context clearing consistent with context mapping +- iommu/vt-d: Disable PCI ATS in legacy passthrough mode +- iommu/vt-d: Omit devTLB invalidation requests when TES=0 +- cpufreq: imx6q: Don't disable 792 Mhz OPP unnecessarily +- drm/amd/display: Remove power sequencing check +- drm/amd/display: Refactor edp power control +- s390/cmma: fix handling of swapper_pg_dir and invalid_pg_dir +- powerpc/pseries/iommu: enable_ddw incorrectly returns direct mapping for SR-IOV device +- net: ravb: Keep reverse order of operations in ravb_remove() +- net: ravb: Stop DMA in case of failures on ravb_open() +- net: ravb: Start TX queues after HW initialization succeeded +- net: ravb: Make write access to CXR35 first before accessing other EMAC registers +- net: ravb: Use pm_runtime_resume_and_get() +- net: ravb: Check return value of reset_control_deassert() +- ice: Fix VF Reset paths when interface in a failed over aggregate +- bpf, sockmap: af_unix stream sockets need to hold ref for pair sock +- ethtool: don't propagate EOPNOTSUPP from dumps +- ravb: Fix races between ravb_tx_timeout_work() and net related ops +- r8169: prevent potential deadlock in rtl8169_close +- efi/unaccepted: Fix off-by-one when checking for overlapping ranges +- neighbour: Fix __randomize_layout crash in struct neighbour +- octeontx2-pf: Restore TC ingress police rules when interface is up +- octeontx2-pf: Fix adding mbox work queue entry when num_vfs > 64 +- net: stmmac: xgmac: Disable FPE MMC interrupts +- octeontx2-af: Fix possible buffer overflow +- selftests/net: mptcp: fix uninitialized variable warnings +- selftests/net: unix: fix unused variable compiler warning +- selftests/net: fix a char signedness issue +- selftests/net: ipsec: fix constant out of range +- uapi: propagate __struct_group() attributes to the container union +- bpf: Add missed allocation hint for bpf_mem_cache_alloc_flags() +- dpaa2-eth: recycle the RX buffer only after all processing done +- dpaa2-eth: increase the needed headroom to account for alignment +- net: dsa: mv88e6xxx: fix marvell 6350 probe crash +- net: dsa: mv88e6xxx: fix marvell 6350 switch probing +- wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during flush +- wifi: iwlwifi: mvm: fix an error code in iwl_mvm_mld_add_sta() +- ipv4: igmp: fix refcnt uaf issue when receiving igmp query packet +- net: rswitch: Fix missing dev_kfree_skb_any() in error path +- net: rswitch: Fix return value in rswitch_start_xmit() +- net: rswitch: Fix type of ret in rswitch_start_xmit() +- netdevsim: Don't accept device bound programs +- media: v4l2-subdev: Fix a 64bit bug +- pinctrl: stm32: fix array read out of bound +- pinctrl: stm32: Add check for devm_kcalloc +- wifi: cfg80211: fix CQM for non-range use +- io_uring/kbuf: recycle freed mapped buffer ring entries +- io_uring/kbuf: defer release of mapped buffer rings +- io_uring: enable io_mem_alloc/free to be used in other parts +- btrfs: fix 64bit compat send ioctl arguments not initializing version member +- btrfs: free the allocated memory if btrfs_alloc_page_array() fails +- btrfs: make error messages more clear when getting a chunk map +- btrfs: send: ensure send_fd is writable +- btrfs: fix off-by-one when checking chunk map includes logical address +- btrfs: ref-verify: fix memory leaks in btrfs_ref_tree_mod() +- btrfs: add dmesg output for first mount and last unmount of a filesystem +- parisc: Mark altinstructions read-only and 32-bit aligned +- parisc: Ensure 32-bit alignment on parisc unwind section +- parisc: Mark jump_table naturally aligned +- parisc: Drop the HP-UX ENOSYM and EREMOTERELEASE error codes +- parisc: Mark lock_aligned variables 16-byte aligned on SMP +- parisc: Use natural CPU alignment for bug_table +- parisc: Mark ex_table entries 32-bit aligned in uaccess.h +- parisc: Mark ex_table entries 32-bit aligned in assembly.h +- powerpc: Don't clobber f0/vs0 during fp|altivec register save +- KVM: PPC: Book3S HV: Fix KVM_RUN clobbering FP/VEC user registers +- iommu/vt-d: Add MTL to quirk list to skip TE disabling +- ext2: Fix ki_pos update for DIO buffered-io fallback case +- bcache: revert replacing IS_ERR_OR_NULL with IS_ERR +- iommu: Avoid more races around device probe +- io_uring: don't guard IORING_OFF_PBUF_RING with SETUP_NO_MMAP +- dma-buf: fix check in dma_resv_add_fence +- cpufreq/amd-pstate: Fix the return value of amd_pstate_fast_switch() +- powercap: DTPM: Fix unneeded conversions to micro-Watts +- nouveau: find the smallest page allocation to cover a buffer alloc. +- io_uring: free io_buffer_list entries via RCU +- iommu/vt-d: Fix incorrect cache invalidation for mm notification +- io_uring: don't allow discontig pages for IORING_SETUP_NO_MMAP +- ACPI: video: Use acpi_video_device for cooling-dev driver data +- r8169: fix deadlock on RTL8125 in jumbo mtu mode +- nvme: check for valid nvme_identify_ns() before using it +- dm verity: don't perform FEC for failed readahead IO +- dm verity: initialize fec io before freeing it +- drm/amd/display: force toggle rate wa for first link training for a retimer +- drm/amd/display: fix ABM disablement +- drm/amd/display: Update min Z8 residency time to 2100 for DCN314 +- drm/amd/display: Use DRAM speed from validation for dummy p-state +- drm/amd/display: Remove min_dst_y_next_start check for Z8 +- drm/amd/display: Include udelay when waiting for INBOX0 ACK +- drm/amdgpu: Update EEPROM I2C address for smu v13_0_0 +- drm/amdgpu: fix memory overflow in the IB test +- drm/amdgpu: Force order between a read and write to the same address +- drm/amdgpu: correct the amdgpu runtime dereference usage count +- drm/amd: Enable PCIe PME from D3 +- scsi: ufs: core: Clear cmd if abort succeeds in MCQ mode +- scsi: sd: Fix system start for ATA devices +- scsi: Change SCSI device boolean fields to single bit flags +- dm-verity: align struct dm_verity_fec_io properly +- net: libwx: fix memory leak on msix entry +- ALSA: hda/realtek: Add supported ALC257 for ChromeOS +- ALSA: hda/realtek: Headset Mic VREF to 100% +- ALSA: hda: Disable power-save on KONTRON SinglePC +- drm/i915: Also check for VGA converter in eDP probe +- mmc: block: Be sure to wait while busy in CQE error recovery +- mmc: block: Do not lose cache flush during CQE error recovery +- mmc: block: Retry commands in CQE error recovery +- mmc: cqhci: Fix task clearing in CQE error recovery +- mmc: cqhci: Warn of halt or task clear failure +- mmc: cqhci: Increase recovery halt timeout +- mmc: sdhci-sprd: Fix vqmmc not shutting down after the card was pulled +- mmc: sdhci-pci-gli: Disable LPM during initialization +- firewire: core: fix possible memory leak in create_units() +- pinctrl: avoid reload of p state in list iteration +- ksmbd: fix possible deadlock in smb2_open +- smb: client: report correct st_size for SMB and NFS symlinks +- smb: client: fix missing mode bits for SMB symlinks +- cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF moved +- cifs: Fix FALLOC_FL_ZERO_RANGE by setting i_size if EOF moved +- leds: class: Don't expose color sysfs entry +- USB: dwc3: qcom: fix wakeup after probe deferral +- USB: dwc3: qcom: fix software node leak on probe errors +- usb: dwc3: set the dma max_seg_size +- usb: dwc3: Fix default mode initialization +- USB: dwc2: write HCINT with INTMASK applied +- usb: typec: tcpm: Skip hard reset when in error recovery +- usb: typec: tcpm: Fix sink caps op current check +- USB: serial: option: don't claim interface 4 for ZTE MF290 +- USB: serial: option: fix FM101R-GL defines +- USB: serial: option: add Fibocom L7xx modules +- usb: cdnsp: Fix deadlock issue during using NCM gadget +- usb: config: fix iteration issue in 'usb_get_bos_descriptor()' +- USB: xhci-plat: fix legacy PHY double init +- bcache: fixup lock c->root error +- bcache: fixup init dirty data errors +- bcache: prevent potential division by zero error +- bcache: check return value from btree_node_alloc_replacement() +- veth: Use tstats per-CPU traffic counters +- dm-delay: fix a race between delay_presuspend and delay_bio +- ALSA: hda/realtek: Add quirks for ASUS 2024 Zenbooks +- ALSA: hda: ASUS UM5302LA: Added quirks for cs35L41/10431A83 on i2c bus +- cifs: fix leak of iface for primary channel +- cifs: account for primary channel in the interface list +- cifs: distribute channels across interfaces based on speed +- Revert "phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY" +- Revert "phy: realtek: usb: Add driver for the Realtek SoC USB 3.0 PHY" +- Revert "usb: phy: add usb phy notify port status API" +- hv_netvsc: Mark VF as slave before exposing it to user-mode +- hv_netvsc: Fix race of register_netdevice_notifier and VF register +- hv_netvsc: fix race of netvsc and VF register_netdevice +- platform/x86: ideapad-laptop: Set max_brightness before using it +- platform/x86/amd/pmc: adjust getting DRAM size behavior +- USB: serial: option: add Luat Air72*U series products +- usb: misc: onboard-hub: add support for Microchip USB5744 +- dt-bindings: usb: microchip,usb5744: Add second supply +- platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes() +- platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes() +- platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes() +- s390/dasd: protect device queue against concurrent access +- io_uring/fs: consider link->flags when getting path for LINKAT +- bcache: fixup multi-threaded bch_sectors_dirty_init() wake-up race +- md: fix bi_status reporting in md_end_clone_io +- bcache: replace a mistaken IS_ERR() by IS_ERR_OR_NULL() in btree_gc_coalesce() +- io_uring: fix off-by one bvec index +- tls: fix NULL deref on tls_sw_splice_eof() with empty record +- swiotlb-xen: provide the "max_mapping_size" method +- ACPI: PM: Add acpi_device_fix_up_power_children() function +- ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA +- ACPI: processor_idle: use raw_safe_halt() in acpi_idle_play_dead() +- ACPI: video: Use acpi_device_fix_up_power_children() +- thunderbolt: Set lane bonding bit only for downstream port +- drm/ast: Disconnect BMC if physical connector is connected +- drm/msm/dpu: Add missing safe_lut_tbl in sc8280xp catalog +- kselftest/arm64: Fix output formatting for za-fork +- prctl: Disable prctl(PR_SET_MDWE) on parisc +- mm: add a NO_INHERIT flag to the PR_SET_MDWE prctl +- lockdep: Fix block chain corruption +- USB: dwc3: qcom: fix ACPI platform device leak +- USB: dwc3: qcom: fix resource leaks on probe deferral +- nvmet: nul-terminate the NQNs passed in the connect command +- nvme: blank out authentication fabrics options if not configured +- afs: Fix file locking on R/O volumes to operate in local mode +- afs: Return ENOENT if no cell DNS record can be found +- net: ipa: fix one GSI register field width +- net: axienet: Fix check for partial TX checksum +- vsock/test: fix SEQPACKET message bounds test +- i40e: Fix adding unsupported cloud filters +- amd-xgbe: propagate the correct speed and duplex status +- amd-xgbe: handle the corner-case during tx completion +- amd-xgbe: handle corner-case during sfp hotplug +- net: veth: fix ethtool stats reporting +- octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx queue than its PF +- arm/xen: fix xen_vcpu_info allocation alignment +- arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y +- s390/ipl: add missing IPL_TYPE_ECKD_DUMP case to ipl_init() +- net/smc: avoid data corruption caused by decline +- net: usb: ax88179_178a: fix failed operations during ax88179_reset +- drm/panel: boe-tv101wum-nl6: Fine tune Himax83102-j02 panel HFP and HBP +- ipv4: Correct/silence an endian warning in __ip_do_redirect +- HID: fix HID device resource race between HID core and debugging support +- accel/ivpu/37xx: Fix hangs related to MMIO reset +- accel/ivpu: Do not initialize parameters on power up +- bpf: Fix dev's rx stats for bpf_redirect_peer traffic +- net: Move {l,t,d}stats allocation to core and convert veth & vrf +- net, vrf: Move dstats structure to core +- PM: tools: Fix sleepgraph syntax error +- drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full +- libfs: getdents() should return 0 after reaching EOD +- block: update the stable_writes flag in bdev_add +- filemap: add a per-mapping stable writes flag +- drm/i915: do not clean GT table on error path +- ata: pata_isapnp: Add missing error check for devm_ioport_map() +- octeontx2-pf: Fix memory leak during interface down +- wireguard: use DEV_STATS_INC() +- net: wangxun: fix kernel panic due to null pointer +- drm/panel: simple: Fix Innolux G101ICE-L01 timings +- drm/panel: simple: Fix Innolux G101ICE-L01 bus flags +- fs: Pass AT_GETATTR_NOSEC flag to getattr interface function +- drm/panel: auo,b101uan08.3: Fine tune the panel power sequence +- blk-cgroup: avoid to warn !rcu_read_lock_held() in blkg_lookup() +- afs: Make error on cell lookup failure consistent with OpenAFS +- afs: Fix afs_server_list to be cleaned up with RCU +- rxrpc: Defer the response to a PING ACK until we've parsed it +- rxrpc: Fix RTT determination to use any ACK as a source +- s390/ism: ism driver implies smc protocol +- drm/msm/dsi: use the correct VREG_CTRL_1 value for 4nm cphy +- sched/fair: Fix the decision for load balance +- sched/eevdf: Fix vruntime adjustment on reweight +- hv/hv_kvp_daemon: Some small fixes for handling NM keyfiles +- irqchip/gic-v3-its: Flush ITS tables correctly in non-coherent GIC designs +- NFSD: Fix checksum mismatches in the duplicate reply cache +- NFSD: Fix "start of NFS reply" pointer passed to nfsd_cache_update() +- !3310 kasan: fix the compilation error for memcpy_mcs() +- kasan: fix the compilation error for memcpy_mcs() +- arm64: arch_timer: disable CONFIG_ARM_ARCH_TIMER_WORKAROUND_IN_USERSPACE +- vdso: do cntvct workaround in the VDSO +- arm64: arch_timer: Disable CNTVCT_EL0 trap if workaround is enabled +- mm/sharepool: Protect the va reserved for sharepool +- mm/sharepool: support fork() and exit() to handle the mm +- mm/sharepool: Add proc interfaces to show sp info +- mm/sharepool: Implement mg_sp_config_dvpp_range() +- mm/sharepool: Implement mg_sp_id_of_current() +- mm/sharepool: Implement mg_sp_group_id_by_pid() +- mm/sharepool: Implement mg_sp_group_add_task() +- mm/sharepool: Implement mg_sp_make_share_k2u() +- mm/sharepool: Implement mg_sp_alloc() +- mm/sharepool: Implement mg_sp_free() +- mm/sharepool: Implement mg_sp_walk_page_range() +- mm/sharepool: Implement mg_sp_unshare_kva +- mm/sharepool: Implement mg_sp_make_share_u2k() +- mm/sharepool: Reserve the va space for share_pool +- mm/sharepool: Add sp_area management code +- mm/sharepool: Add base framework for share_pool +- mm: Extend mmap assocated functions to accept mm_struct +- mm/vmalloc: Extend vmalloc usage about hugepage +- mm/hugetlb: Introduce hugetlb_insert_hugepage_pte[_by_pa] +- ARM: Add unwinding annotations to __loop.*delay functions +- !3285 arm64: errata: add option to disable cache readunique prefetch on HIP08 +- !3280 arm64: add machine check safe support +- !3036 Added SM3 as module signing algorithm +- ext4: Block writes to journal device +- xfs: Block writes to log device +- fs: Block writes to mounted block devices +- btrfs: Do not restrict writes to btrfs devices +- block: Add config option to not allow writing to mounted devices +- arm64: errata: enable HISILICON_ERRATUM_HIP08_RU_PREFETCH +- arm64: errata: add option to disable cache readunique prefetch on HIP08 +- arm64: add machine check safe sysctl interface +- arm64: introduce copy_mc_to_kernel() implementation +- arm64: support copy_mc_[user]_highpage() +- mm/hwpoison: return -EFAULT when copy fail in copy_mc_[user]_highpage() +- arm64: add uaccess to machine check safe +- arm64: add support for machine check error safe +- uaccess: add generic fallback version of copy_mc_to_user() +- !3275 arm64: kernel: disable CNP on LINXICORE9100 +- !3099 block: Make blkdev_get_by_*() return +- arm64: kernel: disable CNP on LINXICORE9100 +- !3111 openeuler_defconfig: enable some mm new +- !3211 Add SDEI Watchdog Support +- !3041 Random boot-time optimization +- !3026 Backport ARM64-ILP32 patches +- !3156 xfs: fix intent item leak during reovery +- !3137 LoongArch: add old BPI compatibility +- !3218 ipvlan: Introduce l2e mode +- !3209 exec: Remove redundant check in do_open_execat/uselib +- ipvlan: Introduce local xmit queue for l2e mode +- ipvlan: Introduce l2e mode +- arm64: kexec: only clear EOI for SDEI in NMI context +- stop_machine: mask sdei before running the callback +- openeuler_defconfig: Enable SDEI Watchdog +- kprobes/arm64: Blacklist sdei watchdog callback functions +- init: only move down lockup_detector_init() when sdei_watchdog is enabled +- sdei_watchdog: avoid possible false hardlockup +- sdei_watchdog: set secure timer period base on 'watchdog_thresh' +- sdei_watchdog: clear EOI of the secure timer before kdump +- watchdog: add nmi_watchdog support for arm64 based on SDEI +- lockup_detector: init lockup detector after all the init_calls +- firmware: arm_sdei: make 'sdei_api_event_disable/enable' public +- firmware: arm_sdei: add interrupt binding api +- exec: Remove redundant check in do_open_execat/uselib +- xfs: abort intent items when recovery intents fail +- xfs: factor out xfs_defer_pending_abort +- !3141 Backport 6.6.3 LTS Patches +- drm/amd/display: Change the DMCUB mailbox memory location from FB to inbox +- drm/amd/display: Clear dpcd_sink_ext_caps if not set +- drm/amd/display: Enable fast plane updates on DCN3.2 and above +- drm/amd/display: fix a NULL pointer dereference in amdgpu_dm_i2c_xfer() +- drm/amd/display: Fix DSC not Enabled on Direct MST Sink +- drm/amd/display: Guard against invalid RPTR/WPTR being set +- drm/amdgpu: Fix possible null pointer dereference +- drm/amdgpu: lower CS errors to debug severity +- drm/amdgpu: fix error handling in amdgpu_bo_list_get() +- drm/amdgpu: fix error handling in amdgpu_vm_init +- drm/amdgpu: don't use ATRM for external devices +- drm/amdgpu: add a retry for IP discovery init +- drm/amdgpu: fix GRBM read timeout when do mes_self_test +- drm/amdgpu: don't use pci_is_thunderbolt_attached() +- drm/amdgpu/smu13: drop compute workload workaround +- drm/amd/pm: Fix error of MACO flag setting code +- drm/i915: Flush WC GGTT only on required platforms +- drm/i915: Fix potential spectre vulnerability +- drm/i915: Bump GLK CDCLK frequency when driving multiple pipes +- drm/i915/mtl: Support HBR3 rate with C10 phy and eDP in MTL +- drm/amd/display: Add Null check for DPP resource +- x86/srso: Move retbleed IBPB check into existing 'has_microcode' code block +- drm: bridge: it66121: ->get_edid callback must not return err pointers +- drm/amd/pm: Handle non-terminated overdrive commands. +- ext4: fix racy may inline data check in dio write +- ext4: properly sync file size update after O_SYNC direct IO +- ext4: add missed brelse in update_backups +- ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks +- ext4: correct the start block of counting reserved clusters +- ext4: correct return value of ext4_convert_meta_bg +- ext4: mark buffer new if it is unwritten to avoid stale data exposure +- ext4: correct offset of gdb backup in non meta_bg group to update_backups +- ext4: apply umask if ACL support is disabled +- ext4: make sure allocate pending entry not fail +- ext4: no need to generate from free list in mballoc +- ext4: fix race between writepages and remount +- Revert "net: r8169: Disable multicast filter for RTL8168H and RTL8107E" +- Revert "HID: logitech-dj: Add support for a new lightspeed receiver iteration" +- media: qcom: camss: Fix csid-gen2 for test pattern generator +- media: qcom: camss: Fix invalid clock enable bit disjunction +- media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3 +- media: qcom: camss: Fix missing vfe_lite clocks check +- media: qcom: camss: Fix VFE-480 vfe_disable_output() +- media: qcom: camss: Fix VFE-17x vfe_disable_output() +- media: qcom: camss: Fix vfe_get() error jump +- media: qcom: camss: Fix pm_domain_on sequence in probe +- mmc: sdhci-pci-gli: GL9750: Mask the replay timer timeout of AER +- r8169: add handling DASH when DASH is disabled +- r8169: fix network lost after resume on DASH systems +- selftests: mptcp: fix fastclose with csum failure +- mptcp: fix setsockopt(IP_TOS) subflow locking +- mptcp: add validity check for sending RM_ADDR +- mptcp: deal with large GSO size +- mm: kmem: drop __GFP_NOFAIL when allocating objcg vectors +- mm: fix for negative counter: nr_file_hugepages +- mmc: sdhci-pci-gli: A workaround to allow GL9750 to enter ASPM L1.2 +- riscv: kprobes: allow writing to x0 +- riscv: correct pt_level name via pgtable_l5/4_enabled +- riscv: mm: Update the comment of CONFIG_PAGE_OFFSET +- riscv: put interrupt entries into .irqentry.text +- riscv: Using TOOLCHAIN_HAS_ZIHINTPAUSE marco replace zihintpause +- swiotlb: fix out-of-bounds TLB allocations with CONFIG_SWIOTLB_DYNAMIC +- swiotlb: do not free decrypted pages if dynamic +- tracing: fprobe-event: Fix to check tracepoint event and return +- LoongArch: Mark __percpu functions as always inline +- NFSD: Update nfsd_cache_append() to use xdr_stream +- nfsd: fix file memleak on client_opens_release +- dm-verity: don't use blocking calls from tasklets +- dm-bufio: fix no-sleep mode +- drm/mediatek/dp: fix memory leak on ->get_edid callback error path +- drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection +- media: ccs: Correctly initialise try compose rectangle +- media: venus: hfi: add checks to handle capabilities from firmware +- media: venus: hfi: fix the check to handle session buffer requirement +- media: venus: hfi_parser: Add check to keep the number of codecs within range +- media: sharp: fix sharp encoding +- media: lirc: drop trailing space from scancode transmit +- f2fs: split initial and dynamic conditions for extent_cache +- f2fs: avoid format-overflow warning +- f2fs: set the default compress_level on ioctl +- f2fs: do not return EFSCORRUPTED, but try to run online repair +- i2c: i801: fix potential race in i801_block_transaction_byte_by_byte +- gfs2: don't withdraw if init_threads() got interrupted +- net: phylink: initialize carrier state at creation +- net: dsa: lan9303: consequently nested-lock physical MDIO +- net: ethtool: Fix documentation of ethtool_sprintf() +- s390/ap: fix AP bus crash on early config change callback invocation +- i2c: designware: Disable TX_EMPTY irq while waiting for block length byte +- sbsa_gwdt: Calculate timeout with 64-bit math +- lsm: fix default return value for inode_getsecctx +- lsm: fix default return value for vm_enough_memory +- Revert "i2c: pxa: move to generic GPIO recovery" +- Revert ncsi: Propagate carrier gain/loss events to the NCSI controller +- ALSA: hda/realtek: Add quirks for HP Laptops +- ALSA: hda/realtek: Enable Mute LED on HP 255 G10 +- ALSA: hda/realtek - Enable internal speaker of ASUS K6500ZC +- ALSA: hda/realtek - Add Dell ALC295 to pin fall back table +- ALSA: hda/realtek: Enable Mute LED on HP 255 G8 +- ALSA: info: Fix potential deadlock at disconnection +- btrfs: zoned: wait for data BG to be finished on direct IO allocation +- xfs: recovery should not clear di_flushiter unconditionally +- cifs: Fix encryption of cleared, but unset rq_iter data buffers +- cifs: do not pass cifs_sb when trying to add channels +- cifs: do not reset chan_max if multichannel is not supported at mount +- cifs: force interface update before a fresh session setup +- cifs: reconnect helper should set reconnect for the right channel +- smb: client: fix mount when dns_resolver key is not available +- smb: client: fix potential deadlock when releasing mids +- smb: client: fix use-after-free in smb2_query_info_compound() +- smb: client: fix use-after-free bug in cifs_debug_data_proc_show() +- smb3: fix caching of ctime on setxattr +- smb3: allow dumping session and tcon id to improve stats analysis and debugging +- smb3: fix touch -h of symlink +- smb3: fix creating FIFOs when mounting with "sfu" mount option +- xhci: Enable RPM on controllers that support low-power states +- parisc: fix mmap_base calculation when stack grows upwards +- parisc/power: Fix power soft-off when running on qemu +- parisc/pgtable: Do not drop upper 5 address bits of physical address +- parisc: Prevent booting 64-bit kernels on PA1.x machines +- selftests/resctrl: Extend signal handler coverage to unmount on receiving signal +- selftests/resctrl: Make benchmark command const and build it with pointers +- selftests/resctrl: Simplify span lifetime +- selftests/resctrl: Remove bw_report and bm_type from main() +- rcutorture: Fix stuttering races and other issues +- torture: Make torture_hrtimeout_ns() take an hrtimer mode parameter +- drm/amd/display: enable dsc_clk even if dsc_pg disabled +- Bluetooth: btusb: Add 0bda:b85b for Fn-Link RTL8852BE +- Bluetooth: btusb: Add RTW8852BE device 13d3:3570 to device tables +- apparmor: Fix regression in mount mediation +- apparmor: pass cred through to audit info. +- apparmor: rename audit_data->label to audit_data->subj_label +- apparmor: combine common_audit_data and apparmor_audit_data +- apparmor: Fix kernel-doc warnings in apparmor/policy.c +- apparmor: Fix kernel-doc warnings in apparmor/resource.c +- apparmor: Fix kernel-doc warnings in apparmor/lib.c +- apparmor: Fix kernel-doc warnings in apparmor/audit.c +- cxl/port: Fix delete_endpoint() vs parent unregistration race +- cxl/region: Fix x1 root-decoder granularity calculations +- i3c: master: svc: fix random hot join failure since timeout error +- i3c: master: svc: fix SDA keep low when polling IBIWON timeout happen +- i3c: master: svc: fix check wrong status register in irq handler +- i3c: master: svc: fix ibi may not return mandatory data byte +- i3c: master: svc: fix wrong data return when IBI happen during start frame +- i3c: master: svc: fix race condition in ibi work thread +- i3c: master: cdns: Fix reading status register +- cxl/region: Do not try to cleanup after cxl_region_setup_targets() fails +- mtd: cfi_cmdset_0001: Byte swap OTP info +- mm: make PR_MDWE_REFUSE_EXEC_GAIN an unsigned long +- mm/memory_hotplug: use pfn math in place of direct struct page manipulation +- mm/hugetlb: use nth_page() in place of direct struct page manipulation +- mm/cma: use nth_page() in place of direct struct page manipulation +- s390/cmma: fix detection of DAT pages +- s390/mm: add missing arch_set_page_dat() call to gmap allocations +- s390/mm: add missing arch_set_page_dat() call to vmem_crst_alloc() +- dmaengine: stm32-mdma: correct desc prep when channel running +- mcb: fix error handling for different scenarios when parsing +- driver core: Release all resources during unbind before updating device links +- tracing: Have the user copy of synthetic event address use correct context +- selftests/clone3: Fix broken test under !CONFIG_TIME_NS +- i2c: core: Run atomic i2c xfer when !preemptible +- mips: use nth_page() in place of direct struct page manipulation +- fs: use nth_page() in place of direct struct page manipulation +- scripts/gdb/vmalloc: disable on no-MMU +- kernel/reboot: emergency_restart: Set correct system_state +- quota: explicitly forbid quota files from being encrypted +- jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev +- ASoC: codecs: wsa-macro: fix uninitialized stack variables with name prefix +- hid: lenovo: Resend all settings on reset_resume for compact keyboards +- selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests +- selftests/resctrl: Fix feature checks +- selftests/resctrl: Refactor feature check to use resource and feature name +- selftests/resctrl: Move _GNU_SOURCE define into Makefile +- selftests/resctrl: Remove duplicate feature check from CMT test +- selftests/resctrl: Fix uninitialized .sa_flags +- ASoC: codecs: wsa883x: make use of new mute_unmute_on_trigger flag +- ASoC: soc-dai: add flag to mute and unmute stream during trigger +- netfilter: nf_tables: split async and sync catchall in two functions +- netfilter: nf_tables: remove catchall element in GC sync path +- ima: detect changes to the backing overlay file +- ima: annotate iint mutex to avoid lockdep false positive warnings +- mfd: qcom-spmi-pmic: Fix revid implementation +- mfd: qcom-spmi-pmic: Fix reference leaks in revid helper +- leds: trigger: netdev: Move size check in set_device_name +- arm64: dts: qcom: ipq6018: Fix tcsr_mutex register size +- arm64: dts: qcom: ipq9574: Fix hwlock index for SMEM +- ACPI: FPDT: properly handle invalid FPDT subtables +- firmware: qcom_scm: use 64-bit calling convention only when client is 64-bit +- arm64: dts: qcom: ipq8074: Fix hwlock index for SMEM +- arm64: dts: qcom: ipq5332: Fix hwlock index for SMEM +- thermal: intel: powerclamp: fix mismatch in get function for max_idle +- btrfs: don't arbitrarily slow down delalloc if we're committing +- rcu: kmemleak: Ignore kmemleak false positives when RCU-freeing objects +- PM: hibernate: Clean up sync_read handling in snapshot_write_next() +- PM: hibernate: Use __get_safe_page() rather than touching the list +- dt-bindings: timer: renesas,rz-mtu3: Fix overflow/underflow interrupt names +- arm64: dts: qcom: ipq6018: Fix hwlock index for SMEM +- rcu/tree: Defer setting of jiffies during stall reset +- svcrdma: Drop connection after an RDMA Read error +- wifi: wilc1000: use vmm_table as array in wilc struct +- PCI: Lengthen reset delay for VideoPropulsion Torrent QN16e card +- PCI: exynos: Don't discard .remove() callback +- PCI: kirin: Don't discard .remove() callback +- PCI/ASPM: Fix L1 substate handling in aspm_attr_store_common() +- PCI: qcom-ep: Add dedicated callback for writing to DBI2 registers +- mmc: Add quirk MMC_QUIRK_BROKEN_CACHE_FLUSH for Micron eMMC Q2J54A +- mmc: sdhci_am654: fix start loop index for TAP value parsing +- mmc: vub300: fix an error code +- ksmbd: fix slab out of bounds write in smb_inherit_dacl() +- ksmbd: handle malformed smb1 message +- ksmbd: fix recursive locking in vfs helpers +- clk: qcom: ipq6018: drop the CLK_SET_RATE_PARENT flag from PLL clocks +- clk: qcom: ipq8074: drop the CLK_SET_RATE_PARENT flag from PLL clocks +- integrity: powerpc: Do not select CA_MACHINE_KEYRING +- clk: visconti: Fix undefined behavior bug in struct visconti_pll_provider +- clk: socfpga: Fix undefined behavior bug in struct stratix10_clock_data +- powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() +- cpufreq: stats: Fix buffer overflow detection in trans_stats() +- parisc/power: Add power soft-off when running on qemu +- parisc/pdc: Add width field to struct pdc_model +- parisc/agp: Use 64-bit LE values in SBA IOMMU PDIR table +- pmdomain: imx: Make imx pgc power domain also set the fwnode +- arm64: module: Fix PLT counting when CONFIG_RANDOMIZE_BASE=n +- arm64: Restrict CPU_BIG_ENDIAN to GNU as or LLVM IAS 15.x or newer +- pmdomain: amlogic: Fix mask for the second NNA mem PD domain +- PCI: keystone: Don't discard .probe() callback +- PCI: keystone: Don't discard .remove() callback +- KEYS: trusted: Rollback init_trusted() consistently +- KEYS: trusted: tee: Refactor register SHM usage +- pmdomain: bcm: bcm2835-power: check if the ASB register is equal to enable +- sched/core: Fix RQCF_ACT_SKIP leak +- genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware +- mmc: meson-gx: Remove setting of CMD_CFG_ERROR +- wifi: ath12k: fix dfs-radar and temperature event locking +- wifi: ath12k: fix htt mlo-offset event locking +- wifi: ath11k: fix gtk offload status event locking +- wifi: ath11k: fix htt pktlog locking +- wifi: ath11k: fix dfs radar event locking +- wifi: ath11k: fix temperature event locking +- regmap: Ensure range selector registers are updated after cache sync +- ACPI: resource: Do IRQ override on TongFang GMxXGxx +- parisc: Add nop instructions after TLB inserts +- mm/damon/sysfs: check error from damon_sysfs_update_target() +- mm/damon/core.c: avoid unintentional filtering out of schemes +- mm/damon/sysfs-schemes: handle tried regions sysfs directory allocation failure +- mm/damon/sysfs-schemes: handle tried region directory allocation failure +- mm/damon/core: avoid divide-by-zero during monitoring results update +- mm/damon: implement a function for max nr_accesses safe calculation +- mm/damon/ops-common: avoid divide-by-zero during region hotness calculation +- mm/damon/lru_sort: avoid divide-by-zero in hot threshold calculation +- dm crypt: account large pages in cc->n_allocated_pages +- fbdev: stifb: Make the STI next font pointer a 32-bit signed offset +- iommufd: Fix missing update of domains_itree after splitting iopt_area +- watchdog: move softlockup_panic back to early_param +- mm/damon/sysfs: update monitoring target regions for online input commit +- mm/damon/sysfs: remove requested targets when online-commit inputs +- PCI/sysfs: Protect driver's D3cold preference from user space +- hvc/xen: fix event channel handling for secondary consoles +- hvc/xen: fix error path in xen_hvc_init() to always register frontend driver +- hvc/xen: fix console unplug +- acpi/processor: sanitize _OSC/_PDC capabilities for Xen dom0 +- tty: serial: meson: fix hard LOCKUP on crtscts mode +- tty/sysrq: replace smp_processor_id() with get_cpu() +- proc: sysctl: prevent aliased sysctls from getting passed to init +- audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() +- audit: don't take task_lock() in audit_exe_compare() code path +- sched: psi: fix unprivileged polling against cgroups +- mmc: sdhci-pci-gli: GL9755: Mask the replay timer timeout of AER +- KVM: x86: Fix lapic timer interrupt lost after loading a snapshot. +- KVM: x86: Clear bit12 of ICR after APIC-write VM-exit +- KVM: x86: Ignore MSR_AMD64_TW_CFG access +- KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space +- x86/cpu/hygon: Fix the CPU topology evaluation for real +- x86/apic/msi: Fix misconfigured non-maskable MSI quirk +- x86/PCI: Avoid PME from D3hot/D3cold for AMD Rembrandt and Phoenix USB4 +- crypto: x86/sha - load modules based on CPU features +- x86/shstk: Delay signal entry SSP write until after user accesses +- scsi: ufs: core: Fix racing issue between ufshcd_mcq_abort() and ISR +- scsi: qla2xxx: Fix system crash due to bad pointer access +- scsi: ufs: qcom: Update PHY settings only when scaling to higher gears +- scsi: megaraid_sas: Increase register read retry rount from 3 to 30 for selected registers +- scsi: mpt3sas: Fix loop logic +- bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END +- bpf: Fix check_stack_write_fixed_off() to correctly spill imm +- spi: Fix null dereference on suspend +- randstruct: Fix gcc-plugin performance mode to stay in group +- powerpc/perf: Fix disabling BHRB and instruction sampling +- perf intel-pt: Fix async branch flags +- media: venus: hfi: add checks to perform sanity on queue pointers +- drivers: perf: Check find_first_bit() return value +- perf: arm_cspmu: Reject events meant for other PMUs +- i915/perf: Fix NULL deref bugs with drm_dbg() calls +- perf/core: Fix cpuctx refcounting +- cifs: fix check of rc in function generate_smb3signingkey +- cifs: spnego: add ';' in HOST_KEY_LEN +- scsi: ufs: core: Expand MCQ queue slot to DeviceQueueDepth + 1 +- tools/power/turbostat: Enable the C-state Pre-wake printing +- tools/power/turbostat: Fix a knl bug +- macvlan: Don't propagate promisc change to lower dev in passthru +- net: sched: do not offload flows with a helper in act_ct +- net/mlx5e: Check return value of snprintf writing to fw_version buffer for representors +- net/mlx5e: Check return value of snprintf writing to fw_version buffer +- net/mlx5e: Reduce the size of icosq_str +- net/mlx5: Increase size of irq name buffer +- net/mlx5e: Update doorbell for port timestamping CQ before the software counter +- net/mlx5e: Track xmit submission to PTP WQ after populating metadata map +- net/mlx5e: Avoid referencing skb after free-ing in drop path of mlx5e_sq_xmit_wqe +- net/mlx5e: Don't modify the peer sent-to-vport rules for IPSec offload +- net/mlx5e: Fix pedit endianness +- net/mlx5e: fix double free of encap_header in update funcs +- net/mlx5e: fix double free of encap_header +- net/mlx5: Decouple PHC .adjtime and .adjphase implementations +- net/mlx5: Free used cpus mask when an IRQ is released +- Revert "net/mlx5: DR, Supporting inline WQE when possible" +- io_uring/fdinfo: remove need for sqpoll lock for thread/pid retrieval +- gve: Fixes for napi_poll when budget is 0 +- pds_core: fix up some format-truncation complaints +- pds_core: use correct index to mask irq +- net: stmmac: avoid rx queue overrun +- net: stmmac: fix rx budget limit check +- netfilter: nf_tables: bogus ENOENT when destroying element which does not exist +- netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval() +- netfilter: nf_conntrack_bridge: initialize err to 0 +- af_unix: fix use-after-free in unix_stream_read_actor() +- net: ethernet: cortina: Fix MTU max setting +- net: ethernet: cortina: Handle large frames +- net: ethernet: cortina: Fix max RX frame define +- bonding: stop the device in bond_setup_by_slave() +- ptp: annotate data-race around q->head and q->tail +- blk-mq: make sure active queue usage is held for bio_integrity_prep() +- xen/events: fix delayed eoi list handling +- ppp: limit MRU to 64K +- net: mvneta: fix calls to page_pool_get_stats +- tipc: Fix kernel-infoleak due to uninitialized TLV value +- net: hns3: fix VF wrong speed and duplex issue +- net: hns3: fix VF reset fail issue +- net: hns3: fix variable may not initialized problem in hns3_init_mac_addr() +- net: hns3: fix out-of-bounds access may occur when coalesce info is read via debugfs +- net: hns3: fix incorrect capability bit display for copper port +- net: hns3: add barrier in vf mailbox reply process +- net: hns3: fix add VLAN fail issue +- xen/events: avoid using info_for_irq() in xen_send_IPI_one() +- net: ti: icssg-prueth: Fix error cleanup on failing pruss_request_mem_region +- net: ti: icssg-prueth: Add missing icss_iep_put to error path +- tty: Fix uninit-value access in ppp_sync_receive() +- ipvlan: add ipvlan_route_v6_outbound() helper +- net: set SOCK_RCU_FREE before inserting socket into hashtable +- bpf: fix control-flow graph checking in privileged mode +- bpf: fix precision backtracking instruction iteration +- bpf: handle ldimm64 properly in check_cfg() +- gcc-plugins: randstruct: Only warn about true flexible arrays +- vhost-vdpa: fix use after free in vhost_vdpa_probe() +- vdpa_sim_blk: allocate the buffer zeroed +- riscv: split cache ops out of dma-noncoherent.c +- drm/i915/tc: Fix -Wformat-truncation in intel_tc_port_init +- gfs2: Silence "suspicious RCU usage in gfs2_permission" warning +- riscv: provide riscv-specific is_trap_insn() +- RISC-V: hwprobe: Fix vDSO SIGSEGV +- SUNRPC: Fix RPC client cleaned up the freed pipefs dentries +- NFSv4.1: fix SP4_MACH_CRED protection for pnfs IO +- SUNRPC: Add an IS_ERR() check back to where it was +- NFSv4.1: fix handling NFS4ERR_DELAY when testing for session trunking +- drm/i915/mtl: avoid stringop-overflow warning +- mtd: rawnand: meson: check return value of devm_kasprintf() +- mtd: rawnand: intel: check return value of devm_kasprintf() +- SUNRPC: ECONNRESET might require a rebind +- dt-bindings: serial: fix regex pattern for matching serial node children +- samples/bpf: syscall_tp_user: Fix array out-of-bound access +- samples/bpf: syscall_tp_user: Rename num_progs into nr_tests +- sched/core: Optimize in_task() and in_interrupt() a bit +- wifi: iwlwifi: Use FW rate for non-data frames +- mtd: rawnand: tegra: add missing check for platform_get_irq() +- pwm: Fix double shift bug +- drm/amdgpu: fix software pci_unplug on some chips +- ALSA: hda/realtek: Add quirk for ASUS UX7602ZM +- drm/qxl: prevent memory leak +- ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings +- i2c: dev: copy userspace array safely +- riscv: VMAP_STACK overflow detection thread-safe +- kgdb: Flush console before entering kgdb on panic +- gfs2: Fix slab-use-after-free in gfs2_qd_dealloc +- drm/amd/display: Avoid NULL dereference of timing generator +- media: imon: fix access to invalid resource for the second interface +- media: ccs: Fix driver quirk struct documentation +- media: cobalt: Use FIELD_GET() to extract Link Width +- gfs2: fix an oops in gfs2_permission +- gfs2: ignore negated quota changes +- media: ipu-bridge: increase sensor_name size +- media: vivid: avoid integer overflow +- media: gspca: cpia1: shift-out-of-bounds in set_flicker +- i3c: master: mipi-i3c-hci: Fix a kernel panic for accessing DAT_data. +- virtio-blk: fix implicit overflow on virtio_max_dma_size +- i2c: sun6i-p2wi: Prevent potential division by zero +- i2c: fix memleak in i2c_new_client_device() +- i2c: i801: Add support for Intel Birch Stream SoC +- i3c: mipi-i3c-hci: Fix out of bounds access in hci_dma_irq_handler +- 9p: v9fs_listxattr: fix %s null argument warning +- 9p/trans_fd: Annotate data-racy writes to file::f_flags +- usb: gadget: f_ncm: Always set current gadget in ncm_bind() +- usb: host: xhci: Avoid XHCI resume delay if SSUSB device is not present +- f2fs: fix error handling of __get_node_page +- f2fs: fix error path of __f2fs_build_free_nids +- soundwire: dmi-quirks: update HP Omen match +- usb: ucsi: glink: use the connector orientation GPIO to provide switch events +- usb: dwc3: core: configure TX/RX threshold for DWC3_IP +- phy: qualcomm: phy-qcom-eusb2-repeater: Zero out untouched tuning regs +- phy: qualcomm: phy-qcom-eusb2-repeater: Use regmap_fields +- dt-bindings: phy: qcom,snps-eusb2-repeater: Add magic tuning overrides +- tty: vcc: Add check for kstrdup() in vcc_probe() +- thunderbolt: Apply USB 3.x bandwidth quirk only in software connection manager +- iio: adc: stm32-adc: harden against NULL pointer deref in stm32_adc_probe() +- mfd: intel-lpss: Add Intel Lunar Lake-M PCI IDs +- exfat: support handle zero-size directory +- HID: Add quirk for Dell Pro Wireless Keyboard and Mouse KM5221W +- crypto: hisilicon/qm - prevent soft lockup in receive loop +- ASoC: Intel: soc-acpi-cht: Add Lenovo Yoga Tab 3 Pro YT3-X90 quirk +- PCI: Use FIELD_GET() in Sapphire RX 5600 XT Pulse quirk +- misc: pci_endpoint_test: Add Device ID for R-Car S4-8 PCIe controller +- PCI: dwc: Add missing PCI_EXP_LNKCAP_MLW handling +- PCI: dwc: Add dw_pcie_link_set_max_link_width() +- PCI: Disable ATS for specific Intel IPU E2000 devices +- PCI: Extract ATS disabling to a helper function +- PCI: Use FIELD_GET() to extract Link Width +- scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup() +- PCI: Do error check on own line to split long "if" conditions +- atm: iphase: Do PCI error checks on own line +- PCI: mvebu: Use FIELD_PREP() with Link Width +- PCI: tegra194: Use FIELD_GET()/FIELD_PREP() with Link Width fields +- gpiolib: of: Add quirk for mt2701-cs42448 ASoC sound +- ALSA: hda: Fix possible null-ptr-deref when assigning a stream +- ARM: 9320/1: fix stack depot IRQ stack filter +- HID: lenovo: Detect quirk-free fw on cptkbd and stop applying workaround +- jfs: fix array-index-out-of-bounds in diAlloc +- jfs: fix array-index-out-of-bounds in dbFindLeaf +- fs/jfs: Add validity check for db_maxag and db_agpref +- fs/jfs: Add check for negative db_l2nbperpage +- scsi: ibmvfc: Remove BUG_ON in the case of an empty event pool +- scsi: hisi_sas: Set debugfs_dir pointer to NULL after removing debugfs +- RDMA/hfi1: Use FIELD_GET() to extract Link Width +- ASoC: SOF: ipc4: handle EXCEPTION_CAUGHT notification from firmware +- crypto: pcrypt - Fix hungtask for PADATA_RESET +- ASoC: cs35l56: Use PCI SSID as the firmware UID +- ASoC: Intel: sof_sdw: Copy PCI SSID to struct snd_soc_card +- ASoC: SOF: Pass PCI SSID to machine driver +- ASoC: soc-card: Add storage for PCI SSID +- ASoC: mediatek: mt8188-mt6359: support dynamic pinctrl +- selftests/efivarfs: create-read: fix a resource leak +- arm64: dts: ls208xa: use a pseudo-bus to constrain usb dma size +- arm64: dts: rockchip: Add NanoPC T6 PCIe e-key support +- soc: qcom: pmic: Fix resource leaks in a device_for_each_child_node() loop +- drm/amd: check num of link levels when update pcie param +- drm/amd/display: fix num_ways overflow error +- drm/amd: Disable PP_PCIE_DPM_MASK when dynamic speed switching not supported +- drm/amdgpu: Fix a null pointer access when the smc_rreg pointer is NULL +- drm/amdkfd: Fix shift out-of-bounds issue +- drm/panel: st7703: Pick different reset sequence +- drm/amdgpu/vkms: fix a possible null pointer dereference +- drm/radeon: fix a possible null pointer dereference +- drm/panel/panel-tpo-tpg110: fix a possible null pointer dereference +- drm/panel: fix a possible null pointer dereference +- drm/amdgpu: Fix potential null pointer derefernce +- drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga +- drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 +- drm/msm/dp: skip validity check for DP CTS EDID checksum +- drm: vmwgfx_surface.c: copy user-array safely +- drm_lease.c: copy user-array safely +- kernel: watch_queue: copy user-array safely +- kernel: kexec: copy user-array safely +- string.h: add array-wrappers for (v)memdup_user() +- drm/amd/display: use full update for clip size increase of large plane source +- drm/amd: Update `update_pcie_parameters` functions to use uint8_t arguments +- drm/amdgpu: update retry times for psp vmbx wait +- drm/amdkfd: Fix a race condition of vram buffer unref in svm code +- drm/amdgpu: not to save bo in the case of RAS err_event_athub +- md: don't rely on 'mddev->pers' to be set in mddev_suspend() +- drm/edid: Fixup h/vsync_end instead of h/vtotal +- drm/amd/display: add seamless pipe topology transition check +- drm/amd/display: Don't lock phantom pipe on disabling +- drm/amd/display: Blank phantom OTG before enabling +- drm/komeda: drop all currently held locks if deadlock happens +- drm/amdkfd: ratelimited SQ interrupt messages +- drm/gma500: Fix call trace when psb_gem_mm_init() fails +- platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e +- of: address: Fix address translation when address-size is greater than 2 +- platform/chrome: kunit: initialize lock for fake ec_dev +- gpiolib: acpi: Add a ignore interrupt quirk for Peaq C1010 +- tsnep: Fix tsnep_request_irq() format-overflow warning +- ACPI: EC: Add quirk for HP 250 G7 Notebook PC +- Bluetooth: Fix double free in hci_conn_cleanup +- Bluetooth: btusb: Add date->evt_skb is NULL check +- wifi: iwlwifi: mvm: fix size check for fw_link_id +- bpf: Ensure proper register state printing for cond jumps +- vsock: read from socket's error queue +- net: sfp: add quirk for FS's 2.5G copper SFP +- wifi: ath10k: Don't touch the CE interrupt registers after power up +- wifi: ath12k: mhi: fix potential memory leak in ath12k_mhi_register() +- net: annotate data-races around sk->sk_dst_pending_confirm +- net: annotate data-races around sk->sk_tx_queue_mapping +- wifi: mt76: fix clang-specific fortify warnings +- wifi: mt76: mt7921e: Support MT7992 IP in Xiaomi Redmibook 15 Pro (2023) +- net: sfp: add quirk for Fiberstone GPON-ONU-34-20BI +- ACPI: APEI: Fix AER info corruption when error status data has multiple sections +- wifi: ath12k: fix possible out-of-bound write in ath12k_wmi_ext_hal_reg_caps() +- wifi: ath10k: fix clang-specific fortify warning +- wifi: ath12k: fix possible out-of-bound read in ath12k_htt_pull_ppdu_stats() +- wifi: ath9k: fix clang-specific fortify warnings +- bpf: Detect IP == ksym.end as part of BPF program +- atl1c: Work around the DMA RX overflow issue +- wifi: mac80211: don't return unset power in ieee80211_get_tx_power() +- wifi: mac80211_hwsim: fix clang-specific fortify warning +- wifi: ath12k: Ignore fragments from uninitialized peer in dp +- wifi: plfxlc: fix clang-specific fortify warning +- x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size +- workqueue: Provide one lock class key per work_on_cpu() callsite +- cpu/hotplug: Don't offline the last non-isolated CPU +- smp,csd: Throw an error if a CSD lock is stuck for too long +- srcu: Only accelerate on enqueue time +- clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware +- clocksource/drivers/timer-imx-gpt: Fix potential memory leak +- selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config +- srcu: Fix srcu_struct node grpmask overflow on 64-bit systems +- perf/core: Bail out early if the request AUX area is out of bound +- x86/retpoline: Make sure there are no unconverted return thunks due to KCSAN +- lib/generic-radix-tree.c: Don't overflow in peek() +- btrfs: abort transaction on generation mismatch when marking eb as dirty +- locking/ww_mutex/test: Fix potential workqueue corruption +- LoongArch: use arch specific phys_to_dma +- LoongArch: Fixed EIOINTC structure members +- LoongArch: Fix virtual machine startup error +- LoongArch: Old BPI compatibility +- LoongArch: add kernel setvirtmap for runtime +- arm64: openeuler_defconfig: update for new feature +- x86: openeuler_defconfig: update from new feature +- erofs: fix NULL dereference of dif->bdev_handle in fscache mode +- block: Remove blkdev_get_by_*() functions +- bcache: Fixup error handling in register_cache() +- xfs: Convert to bdev_open_by_path() +- reiserfs: Convert to bdev_open_by_dev/path() +- ocfs2: Convert to use bdev_open_by_dev() +- nfs/blocklayout: Convert to use bdev_open_by_dev/path() +- jfs: Convert to bdev_open_by_dev() +- f2fs: Convert to bdev_open_by_dev/path() +- ext4: Convert to bdev_open_by_dev() +- erofs: Convert to use bdev_open_by_path() +- btrfs: Convert to bdev_open_by_path() +- fs: Convert to bdev_open_by_dev() +- mm/swap: Convert to use bdev_open_by_dev() +- PM: hibernate: Drop unused snapshot_test argument +- PM: hibernate: Convert to bdev_open_by_dev() +- scsi: target: Convert to bdev_open_by_path() +- s390/dasd: Convert to bdev_open_by_path() +- nvmet: Convert to bdev_open_by_path() +- mtd: block2mtd: Convert to bdev_open_by_dev/path() +- md: Convert to bdev_open_by_dev() +- dm: Convert to bdev_open_by_dev() +- bcache: Convert to bdev_open_by_path() +- zram: Convert to use bdev_open_by_dev() +- xen/blkback: Convert to bdev_open_by_dev() +- rnbd-srv: Convert to use bdev_open_by_path() +- pktcdvd: Convert to bdev_open_by_dev() +- drdb: Convert to use bdev_open_by_path() +- block: Use bdev_open_by_dev() in disk_scan_partitions() and blkdev_bszset() +- block: Use bdev_open_by_dev() in blkdev_open() +- block: Provide bdev_open_* functions +- alinux: random: speed up the initialization of module +- keys: Allow automatic module signature with SM3 +- arm64: fix image size inflation with CONFIG_COMPAT_TASK_SIZE +- arm64: set 32-bit compatible TASK_SIZE_MAX to fix U32 libc_write_01 error +- arm64: replace is_compat_task() with is_ilp32_compat_task() in TASK_SIZE_MAX +- arm64: fix address limit problem with TASK_SIZE_MAX +- ilp32: fix compile problem when ARM64_ILP32 and UBSAN are both enabled +- arm64: fix abi change caused by ILP32 +- arm64: fix AUDIT_ARCH_AARCH64ILP32 bug on audit subsystem +- ilp32: skip ARM erratum 1418040 for ilp32 application +- ilp32: avoid clearing upper 32 bits of syscall return value for ilp32 +- arm64: secomp: fix the secure computing mode 1 syscall check for ilp32 +- arm64:ilp32: add ARM64_ILP32 to Kconfig +- arm64:ilp32: add vdso-ilp32 and use for signal return +- arm64: ptrace: handle ptrace_request differently for aarch32 and ilp32 +- arm64: ilp32: introduce ilp32-specific sigframe and ucontext +- arm64: signal32: move ilp32 and aarch32 common code to separated file +- arm64: signal: share lp64 signal structures and routines to ilp32 +- arm64: ilp32: introduce syscall table for ILP32 +- arm64: ilp32: share aarch32 syscall handlers +- arm64: ilp32: introduce binfmt_ilp32.c +- arm64: change compat_elf_hwcap and compat_elf_hwcap2 prefix to a32 +- arm64: introduce binfmt_elf32.c +- arm64: introduce AUDIT_ARCH_AARCH64ILP32 for ilp32 +- arm64: ilp32: add is_ilp32_compat_{task,thread} and TIF_32BIT_AARCH64 +- arm64: introduce is_a32_compat_{task,thread} for AArch32 compat +- arm64: uapi: set __BITS_PER_LONG correctly for ILP32 and LP64 +- arm64: rename functions that reference compat term +- arm64: rename COMPAT to AARCH32_EL0 +- arm64: ilp32: add documentation on the ILP32 ABI for ARM64 +- thread: move thread bits accessors to separated file +- ptrace: Add compat PTRACE_{G,S}ETSIGMASK handlers +- arm64: signal: Make parse_user_sigframe() independent of rt_sigframe layout + +* Tue Dec 5 2023 Zheng Zengkai - 6.6.0-1.0.0.1 +- !3058 tcp/dccp: Add another way to allocate local ports in connect() +- !3064 mm: PCP high auto-tuning +- !2985 hugetlbfs: avoid overflow in hugetlbfs_fallocate +- !3059 Handle more faults under the VMA lock +- mm, pcp: reduce detecting time of consecutive high order page freeing +- mm, pcp: decrease PCP high if free pages < high watermark +- mm: tune PCP high automatically +- mm: add framework for PCP high auto-tuning +- mm, page_alloc: scale the number of pages that are batch allocated +- mm: restrict the pcp batch scale factor to avoid too long latency +- mm, pcp: reduce lock contention for draining high-order pages +- cacheinfo: calculate size of per-CPU data cache slice +- mm, pcp: avoid to drain PCP when process exit +- mm: handle write faults to RO pages under the VMA lock +- mm: handle read faults under the VMA lock +- mm: handle COW faults under the VMA lock +- mm: handle shared faults under the VMA lock +- mm: call wp_page_copy() under the VMA lock +- mm: make lock_folio_maybe_drop_mmap() VMA lock aware +- tcp/dccp: Add another way to allocate local ports in connect() +- !3044 mm: hugetlb: Skip initialization of gigantic tail struct pages if freed by HVO +- !2980 io_uring: fix soft lockup in io_submit_sqes() +- !3014 anolis: bond: broadcast ARP or ND messages to all slaves +- !3018 folio conversions for numa balance +- mm: hugetlb: skip initialization of gigantic tail struct pages if freed by HVO +- memblock: introduce MEMBLOCK_RSRV_NOINIT flag +- memblock: pass memblock_type to memblock_setclr_flag +- mm: hugetlb_vmemmap: use nid of the head page to reallocate it +- mm: remove page_cpupid_xchg_last() +- mm: use folio_xchg_last_cpupid() in wp_page_reuse() +- mm: convert wp_page_reuse() and finish_mkwrite_fault() to take a folio +- mm: make finish_mkwrite_fault() static +- mm: huge_memory: use folio_xchg_last_cpupid() in __split_huge_page_tail() +- mm: migrate: use folio_xchg_last_cpupid() in folio_migrate_flags() +- sched/fair: use folio_xchg_last_cpupid() in should_numa_migrate_memory() +- mm: add folio_xchg_last_cpupid() +- mm: remove xchg_page_access_time() +- mm: huge_memory: use a folio in change_huge_pmd() +- mm: mprotect: use a folio in change_pte_range() +- sched/fair: use folio_xchg_access_time() in numa_hint_fault_latency() +- mm: add folio_xchg_access_time() +- mm: remove page_cpupid_last() +- mm: huge_memory: use folio_last_cpupid() in __split_huge_page_tail() +- mm: huge_memory: use folio_last_cpupid() in do_huge_pmd_numa_page() +- mm: memory: use folio_last_cpupid() in do_numa_page() +- mm: add folio_last_cpupid() +- mm_types: add virtual and _last_cpupid into struct folio +- sched/numa, mm: make numa migrate functions to take a folio +- mm: mempolicy: make mpol_misplaced() to take a folio +- mm: memory: make numa_migrate_prep() to take a folio +- mm: memory: use a folio in do_numa_page() +- mm: huge_memory: use a folio in do_huge_pmd_numa_page() +- mm: memory: add vm_normal_folio_pmd() +- mm: migrate: remove isolated variable in add_page_for_migration() +- mm: migrate: remove PageHead() check for HugeTLB in add_page_for_migration() +- mm: migrate: use a folio in add_page_for_migration() +- mm: migrate: use __folio_test_movable() +- mm: migrate: convert migrate_misplaced_page() to migrate_misplaced_folio() +- mm: migrate: convert numamigrate_isolate_page() to numamigrate_isolate_folio() +- mm: migrate: remove THP mapcount check in numamigrate_isolate_page() +- mm: migrate: remove PageTransHuge check in numamigrate_isolate_page() +- anolis: bond: broadcast ARP or ND messages to all slaves +- hugetlbfs: avoid overflow in hugetlbfs_fallocate +- io_uring: fix soft lockup in io_submit_sqes() +- !2971 net: sched: sch_qfq: Use non-work-conserving warning handler +- !2968 checkpatch: Update link tags to fix ci warning +- net: sched: sch_qfq: Use non-work-conserving warning handler +- checkpatch: Update check of link tags +- !2945 Backport linux 6.6.2 LTS patches +- btrfs: make found_logical_ret parameter mandatory for function queue_scrub_stripe() +- btrfs: use u64 for buffer sizes in the tree search ioctls +- Revert "mmc: core: Capture correct oemid-bits for eMMC cards" +- Revert "PCI/ASPM: Disable only ASPM_STATE_L1 when driver, disables L1" +- x86/amd_nb: Use Family 19h Models 60h-7Fh Function 4 IDs +- io_uring/net: ensure socket is marked connected on connect retry +- selftests: mptcp: fix wait_rm_addr/sf parameters +- selftests: mptcp: run userspace pm tests slower +- eventfs: Check for NULL ef in eventfs_set_attr() +- tracing/kprobes: Fix the order of argument descriptions +- fbdev: fsl-diu-fb: mark wr_reg_wa() static +- ALSA: hda/realtek: Add support dual speaker for Dell +- fbdev: imsttfb: fix a resource leak in probe +- fbdev: imsttfb: fix double free in probe() +- arm64/arm: arm_pmuv3: perf: Don't truncate 64-bit registers +- spi: spi-zynq-qspi: add spi-mem to driver kconfig dependencies +- ASoC: dapm: fix clock get name +- ASoC: hdmi-codec: register hpd callback on component probe +- ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: trivial: fix error messages +- ASoC: rt712-sdca: fix speaker route missing issue +- drm/syncobj: fix DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE +- drm/vc4: tests: Fix UAF in the mock helpers +- fs: dlm: Simplify buffer size computation in dlm_create_debug_file() +- module/decompress: use kvmalloc() consistently +- drivers: perf: Do not broadcast to other cpus when starting a counter +- net: ti: icss-iep: fix setting counter value +- RISC-V: Don't fail in riscv_of_parent_hartid() for disabled HARTs +- net/sched: act_ct: Always fill offloading tuple iifidx +- netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses +- netfilter: xt_recent: fix (increase) ipv6 literal buffer length +- i2c: iproc: handle invalid slave state +- net: enetc: shorten enetc_setup_xdp_prog() error message to fit NETLINK_MAX_FMTMSG_LEN +- virtio/vsock: Fix uninit-value in virtio_transport_recv_pkt() +- r8169: respect userspace disabling IFF_MULTICAST +- vsock/virtio: remove socket from connected/bound list on shutdown +- blk-core: use pr_warn_ratelimited() in bio_check_ro() +- nbd: fix uaf in nbd_open +- tg3: power down device only on SYSTEM_POWER_OFF +- ice: Fix VF-VF direction matching in drop rule in switchdev +- ice: Fix VF-VF filter rules in switchdev mode +- ice: lag: in RCU, use atomic allocation +- ice: Fix SRIOV LAG disable on non-compliant aggregate +- riscv: boot: Fix creation of loader.bin +- nvme: fix error-handling for io_uring nvme-passthrough +- net/smc: put sk reference if close work was canceled +- net/smc: allow cdc msg send rather than drop it with NULL sndbuf_desc +- net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT +- octeontx2-pf: Free pending and dropped SQEs +- selftests: pmtu.sh: fix result checking +- net: stmmac: xgmac: Enable support for multiple Flexible PPS outputs +- Fix termination state for idr_for_each_entry_ul() +- net: r8169: Disable multicast filter for RTL8168H and RTL8107E +- dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. +- dccp: Call security_inet_conn_request() after setting IPv4 addresses. +- net: page_pool: add missing free_percpu when page_pool_init fail +- octeontx2-pf: Fix holes in error code +- octeontx2-pf: Fix error codes +- inet: shrink struct flowi_common +- bpf: Check map->usercnt after timer->timer is assigned +- rxrpc: Fix two connection reaping bugs +- tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING +- hsr: Prevent use after free in prp_create_tagged_frame() +- llc: verify mac len before reading mac header +- watchdog: ixp4xx: Make sure restart always works +- watchdog: marvell_gti_wdt: Fix error code in probe() +- Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() +- pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume +- pwm: sti: Reduce number of allocations and drop usage of chip_data +- drm/amdgpu: don't put MQDs in VRAM on ARM | ARM64 +- drm/amdgpu/gfx10,11: use memcpy_to/fromio for MQDs +- regmap: prevent noinc writes from clobbering cache +- cpupower: fix reference to nonexistent document +- media: cec: meson: always include meson sub-directory in Makefile +- media: platform: mtk-mdp3: fix uninitialized variable in mdp_path_config() +- media: mediatek: vcodec: using encoder device to alloc/free encoder memory +- media: imx-jpeg: notify source chagne event when the first picture parsed +- media: mediatek: vcodec: Handle invalid encoder vsi +- media: verisilicon: Fixes clock list for rk3588 av1 decoder +- media: dvb-usb-v2: af9035: fix missing unlock +- media: cadence: csi2rx: Unregister v4l2 async notifier +- media: i2c: imx219: Drop IMX219_REG_CSI_LANE_MODE from common regs array +- media: i2c: imx219: Replace register addresses with macros +- media: i2c: imx219: Convert to CCI register access helpers +- media: cedrus: Fix clock/reset sequence +- media: vidtv: mux: Add check and kfree for kstrdup +- media: vidtv: psi: Add check for kstrdup +- media: s3c-camif: Avoid inappropriate kfree() +- media: mtk-jpegenc: Fix bug in JPEG encode quality selection +- media: amphion: handle firmware debug message +- media: bttv: fix use after free error due to btv->timeout timer +- media: ov5640: Fix a memory leak when ov5640_probe fails +- media: i2c: max9286: Fix some redundant of_node_put() calls +- media: ov5640: fix vblank unchange issue when work at dvp mode +- media: ov13b10: Fix some error checking in probe +- media: verisilicon: Do not enable G2 postproc downscale if source is narrower than destination +- media: hantro: Check whether reset op is defined before use +- media: imx-jpeg: initiate a drain of the capture queue in dynamic resolution change +- pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() +- pcmcia: ds: fix refcount leak in pcmcia_device_add() +- pcmcia: cs: fix possible hung task and memory leak pccardd() +- cxl/hdm: Remove broken error path +- cxl/port: Fix @host confusion in cxl_dport_setup_regs() +- cxl/core/regs: Rename @dev to @host in struct cxl_register_map +- cxl/region: Fix cxl_region_rwsem lock held when returning to user space +- cxl/region: Use cxl_calc_interleave_pos() for auto-discovery +- cxl/region: Calculate a target position in a region interleave +- cxl/region: Prepare the decoder match range helper for reuse +- rtc: pcf85363: fix wrong mask/val parameters in regmap_update_bits call +- virt: sevguest: Fix passing a stack buffer as a scatterlist target +- cxl/mem: Fix shutdown order +- cxl/memdev: Fix sanitize vs decoder setup locking +- cxl/pci: Fix sanitize notifier setup +- cxl/pci: Clarify devm host for memdev relative setup +- cxl/pci: Remove inconsistent usage of dev_err_probe() +- cxl/pci: Cleanup 'sanitize' to always poll +- cxl/pci: Remove unnecessary device reference management in sanitize work +- rtc: brcmstb-waketimer: support level alarm_irq +- i3c: Fix potential refcount leak in i3c_master_register_new_i3c_devs +- rtla: Fix uninitialized variable found +- 9p/net: fix possible memory leak in p9_check_errors() +- perf vendor events intel: Add broadwellde two metrics +- perf vendor events intel: Fix broadwellde tma_info_system_dram_bw_use metric +- perf hist: Add missing puts to hist__account_cycles +- libperf rc_check: Make implicit enabling work for GCC +- perf machine: Avoid out of bounds LBR memory read +- powerpc/vmcore: Add MMU information to vmcoreinfo +- usb: host: xhci-plat: fix possible kernel oops while resuming +- xhci: Loosen RPM as default policy to cover for AMD xHC 1.1 +- perf vendor events: Update PMC used in PM_RUN_INST_CMPL event for power10 platform +- powerpc/pseries: fix potential memory leak in init_cpu_associativity() +- powerpc/imc-pmu: Use the correct spinlock initializer. +- powerpc/vas: Limit open window failure messages in log bufffer +- perf trace: Use the right bpf_probe_read(_str) variant for reading user data +- powerpc: Hide empty pt_regs at base of the stack +- powerpc/xive: Fix endian conversion size +- powerpc/40x: Remove stale PTE_ATOMIC_UPDATES macro +- perf tools: Do not ignore the default vmlinux.h +- modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host +- modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host +- s390/ap: re-init AP queues on config on +- perf mem-events: Avoid uninitialized read +- perf parse-events: Fix for term values that are raw events +- perf build: Add missing comment about NO_LIBTRACEEVENT=1 +- interconnect: fix error handling in qnoc_probe() +- powerpc: Only define __parse_fpscr() when required +- interconnect: qcom: osm-l3: Replace custom implementation of COUNT_ARGS() +- interconnect: qcom: sm8350: Set ACV enable_mask +- interconnect: qcom: sm8250: Set ACV enable_mask +- interconnect: qcom: sm8150: Set ACV enable_mask +- interconnect: qcom: sm6350: Set ACV enable_mask +- interconnect: qcom: sdm845: Set ACV enable_mask +- interconnect: qcom: sdm670: Set ACV enable_mask +- interconnect: qcom: sc8280xp: Set ACV enable_mask +- interconnect: qcom: sc8180x: Set ACV enable_mask +- interconnect: qcom: sc7280: Set ACV enable_mask +- interconnect: qcom: sc7180: Set ACV enable_mask +- interconnect: qcom: qdu1000: Set ACV enable_mask +- f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() +- dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() +- USB: usbip: fix stub_dev hub disconnect +- tools: iio: iio_generic_buffer ensure alignment +- debugfs: Fix __rcu type comparison warning +- misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() +- tools/perf: Update call stack check in builtin-lock.c +- dmaengine: ti: edma: handle irq_of_parse_and_map() errors +- usb: chipidea: Simplify Tegra DMA alignment code +- usb: chipidea: Fix DMA overwrite for Tegra +- usb: dwc2: fix possible NULL pointer dereference caused by driver concurrency +- dmaengine: idxd: Register dsa_bus_type before registering idxd sub-drivers +- perf record: Fix BTF type checks in the off-cpu profiling +- perf vendor events arm64: Fix for AmpereOne metrics +- pinctrl: renesas: rzg2l: Make reverse order of enable() for disable() +- livepatch: Fix missing newline character in klp_resolve_symbols() +- perf parse-events: Fix tracepoint name memory leak +- tty: tty_jobctrl: fix pid memleak in disassociate_ctty() +- f2fs: fix to drop meta_inode's page cache in f2fs_put_super() +- f2fs: compress: fix to avoid redundant compress extension +- f2fs: compress: fix to avoid use-after-free on dic +- f2fs: compress: fix deadloop in f2fs_write_cache_pages() +- perf kwork: Set ordered_events to true in 'struct perf_tool' +- perf kwork: Add the supported subcommands to the document +- perf kwork: Fix incorrect and missing free atom in work_push_atom() +- pinctrl: baytrail: fix debounce disable case +- iio: frequency: adf4350: Use device managed functions and fix power down issue. +- perf stat: Fix aggr mode initialization +- apparmor: fix invalid reference on profile->disconnected +- scripts/gdb: fix usage of MOD_TEXT not defined when CONFIG_MODULES=n +- leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' +- leds: pwm: Don't disable the PWM when the LED should be off +- leds: turris-omnia: Do not use SMBUS calls +- mfd: arizona-spi: Set pdata.hpdet_channel for ACPI enumerated devs +- dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC +- mfd: dln2: Fix double put in dln2_probe +- mfd: core: Ensure disabled devices are skipped without aborting +- mfd: core: Un-constify mfd_cell.of_reg +- IB/mlx5: Fix init stage error handling to avoid double free of same QP and UAF +- erofs: fix erofs_insert_workgroup() lockref usage +- ASoC: ams-delta.c: use component after check +- crypto: qat - fix deadlock in backlog processing +- crypto: qat - fix ring to service map for QAT GEN4 +- crypto: qat - use masks for AE groups +- crypto: qat - refactor fw config related functions +- crypto: qat - enable dc chaining service +- crypto: qat - consolidate services structure +- certs: Break circular dependency when selftest is modular +- padata: Fix refcnt handling in padata_free_shell() +- PCI: endpoint: Fix double free in __pci_epc_create() +- ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails +- HID: logitech-hidpp: Move get_wireless_feature_index() check to hidpp_connect_event() +- HID: logitech-hidpp: Revert "Don't restart communication if not necessary" +- HID: logitech-hidpp: Don't restart IO, instead defer hid_connect() only +- sh: bios: Revive earlyprintk support +- HID: uclogic: Fix a work->entry not empty bug in __queue_work() +- HID: uclogic: Fix user-memory-access bug in uclogic_params_ugee_v2_init_event_hooks() +- hid: cp2112: Fix IRQ shutdown stopping polling for all IRQs on chip +- RDMA/hfi1: Workaround truncation compilation error +- scsi: ufs: core: Leave space for '\0' in utf8 desc string +- ASoC: fsl: Fix PM disable depth imbalance in fsl_easrc_probe +- ASoC: intel: sof_sdw: Stop processing CODECs when enough are found +- ASoC: SOF: core: Ensure sof_ops_free() is still called when probe never ran. +- RDMA/hns: Fix init failure of RoCE VF and HIP08 +- RDMA/hns: Fix unnecessary port_num transition in HW stats allocation +- RDMA/hns: The UD mode can only be configured with DCQCN +- RDMA/hns: Add check for SL +- RDMA/hns: Fix signed-unsigned mixed comparisons +- RDMA/hns: Fix uninitialized ucmd in hns_roce_create_qp_common() +- RDMA/hns: Fix printing level of asynchronous events +- IB/mlx5: Fix rdma counter binding for RAW QP +- dlm: fix no ack after final message +- dlm: be sure we reset all nodes at forced shutdown +- dlm: fix remove member after close call +- dlm: fix creating multiple node structures +- fs: dlm: Fix the size of a buffer in dlm_create_debug_file() +- ASoC: fsl-asoc-card: Add comment for mclk in the codec_priv +- ASoC: Intel: sof_sdw_rt_sdca_jack_common: add rt713 support +- backlight: pwm_bl: Disable PWM on shutdown, suspend and remove +- ASoC: fsl: mpc5200_dma.c: Fix warning of Function parameter or member not described +- kselftest: vm: fix mdwe's mmap_FIXED test case +- ext4: move 'ix' sanity check to corrent position +- ext4: add missing initialization of call_notify_error in update_super_work() +- ARM: 9323/1: mm: Fix ARCH_LOW_ADDRESS_LIMIT when CONFIG_ZONE_DMA +- ARM: 9321/1: memset: cast the constant byte to unsigned char +- crypto: hisilicon/qm - fix PF queue parameter issue +- hid: cp2112: Fix duplicate workqueue initialization +- PCI: vmd: Correct PCI Header Type Register's multi-function check +- ASoC: SOF: ipc4-topology: Use size_add() in call to struct_size() +- crypto: qat - increase size of buffers +- crypto: caam/jr - fix Chacha20 + Poly1305 self test failure +- crypto: caam/qi2 - fix Chacha20 + Poly1305 self test failure +- nd_btt: Make BTT lanes preemptible +- libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value +- ASoC: soc-pcm.c: Make sure DAI parameters cleared if the DAI becomes inactive +- scsi: ibmvfc: Fix erroneous use of rtas_busy_delay with hcall return code +- crypto: qat - fix unregistration of compression algorithms +- crypto: qat - fix unregistration of crypto algorithms +- crypto: qat - ignore subsequent state up commands +- crypto: qat - fix state machines cleanup paths +- RDMA/core: Use size_{add,sub,mul}() in calls to struct_size() +- hwrng: geode - fix accessing registers +- hwrng: bcm2835 - Fix hwrng throughput regression +- crypto: hisilicon/hpre - Fix a erroneous check after snprintf() +- crypto: ccp - Fix some unfused tests +- crypto: ccp - Fix sample application signature passing +- crypto: ccp - Fix DBC sample application error handling +- crypto: ccp - Fix ioctl unit tests +- crypto: ccp - Get a free page to use while fetching initial nonce +- KEYS: Include linux/errno.h in linux/verification.h +- ALSA: hda: cs35l41: Undo runtime PM changes at driver exit time +- ALSA: hda: cs35l41: Fix unbalanced pm_runtime_get() +- ASoC: cs35l41: Undo runtime PM changes at driver exit time +- ASoC: cs35l41: Verify PM runtime resume errors in IRQ handler +- ASoC: cs35l41: Fix broken shared boost activation +- ASoC: cs35l41: Initialize completion object before requesting IRQ +- ASoC: cs35l41: Handle mdsync_up reg write errors +- ASoC: cs35l41: Handle mdsync_down reg write errors +- module/decompress: use vmalloc() for gzip decompression workspace +- iommufd: Add iopt_area_alloc() +- ARM: dts: BCM5301X: Explicitly disable unused switch CPU ports +- soc: qcom: pmic_glink: fix connector type to be DisplayPort +- selftests/resctrl: Ensure the benchmark commands fits to its array +- selftests/pidfd: Fix ksft print formats +- arm64: tegra: Use correct interrupts for Tegra234 TKE +- memory: tegra: Set BPMP msg flags to reset IPC channels +- firmware: tegra: Add suspend hook and reset BPMP IPC early on resume +- arm64: tegra: Fix P3767 QSPI speed +- arm64: tegra: Fix P3767 card detect polarity +- arm64: dts: imx8mn: Add sound-dai-cells to micfil node +- arm64: dts: imx8mm: Add sound-dai-cells to micfil node +- arm64: dts: imx8mp-debix-model-a: Remove USB hub reset-gpios +- arm64: dts: imx8qm-ss-img: Fix jpegenc compatible entry +- clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped +- ARM: dts: am3517-evm: Fix LED3/4 pinmux +- firmware: arm_ffa: Allow the FF-A drivers to use 32bit mode of messaging +- firmware: arm_ffa: Assign the missing IDR allocation ID to the FFA device +- arm64: dts: ti: Fix HDMI Audio overlay in Makefile +- arm64: dts: ti: k3-am62a7-sk: Drop i2c-1 to 100Khz +- arm64: dts: ti: k3-am625-beagleplay: Fix typo in ramoops reg +- arm64: dts: ti: verdin-am62: disable MIPI DSI bridge +- arm64: dts: ti: k3-j721s2-evm-gesi: Specify base dtb for overlay file +- firmware: ti_sci: Mark driver as non removable +- ARM: dts: stm32: stm32f7-pinctrl: don't use multiple blank lines +- kunit: test: Fix the possible memory leak in executor_test +- kunit: Fix possible memory leak in kunit_filter_suites() +- kunit: Fix the wrong kfree of copy for kunit_filter_suites() +- kunit: Fix missed memory release in kunit_free_suite_set() +- soc: qcom: llcc: Handle a second device without data corruption +- ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator +- ARM: dts: qcom: apq8026-samsung-matisse-wifi: Fix inverted hall sensor +- arm64: dts: qcom: apq8016-sbc: Add missing ADV7533 regulators +- riscv: dts: allwinner: remove address-cells from intc node +- arm64: dts: qcom: msm8939: Fix iommu local address range +- arm64: dts: qcom: msm8976: Fix ipc bit shifts +- ARM64: dts: marvell: cn9310: Use appropriate label for spi1 pins +- arm64: dts: qcom: sdx75-idp: align RPMh regulator nodes with bindings +- arm64: dts: qcom: sdm845-mtp: fix WiFi configuration +- arm64: dts: qcom: sm8350: fix pinctrl for UART18 +- arm64: dts: qcom: sm8150: add ref clock to PCIe PHYs +- arm64: dts: qcom: sc7280: drop incorrect EUD port on SoC side +- arm64: dts: qcom: sdm670: Fix pdc mapping +- arm64: dts: qcom: qrb2210-rb1: Fix regulators +- arm64: dts: qcom: qrb2210-rb1: Swap UART index +- arm64: dts: qcom: sc7280: Add missing LMH interrupts +- arm64: dts: qcom: sm6125: Pad APPS IOMMU address to 8 characters +- arm64: dts: qcom: msm8992-libra: drop duplicated reserved memory +- arm64: dts: qcom: msm8916: Fix iommu local address range +- arm64: dts: qcom: sc7280: link usb3_phy_wrapper_gcc_usb30_pipe_clk +- arm64: dts: qcom: sdm845: cheza doesn't support LMh node +- arm64: dts: qcom: sdm845: Fix PSCI power domain names +- ARM: dts: renesas: blanche: Fix typo in GP_11_2 pin name +- perf: hisi: Fix use-after-free when register pmu fails +- drivers/perf: hisi_pcie: Check the type first in pmu::event_init() +- perf/arm-cmn: Fix DTC domain detection +- drm/amd/pm: Fix a memory leak on an error path +- drivers/perf: hisi: use cpuhp_state_remove_instance_nocalls() for hisi_hns3_pmu uninit process +- drm: mediatek: mtk_dsi: Fix NO_EOT_PACKET settings/handling +- clocksource/drivers/arm_arch_timer: limit XGene-1 workaround +- drm/msm/dsi: free TX buffer in unbind +- drm/msm/dsi: use msm_gem_kernel_put to free TX buffer +- xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled +- xen: irqfd: Use _IOW instead of the internal _IOC() macro +- xen: Make struct privcmd_irqfd's layout architecture independent +- xenbus: fix error exit in xenbus_init() +- drm/rockchip: Fix type promotion bug in rockchip_gem_iommu_map() +- arm64/arm: xen: enlighten: Fix KPTI checks +- drm/bridge: lt9611uxc: fix the race in the error path +- gpu: host1x: Correct allocated size for contexts +- drm/rockchip: cdn-dp: Fix some error handling paths in cdn_dp_probe() +- drm/msm/a6xx: Fix unknown speedbin case +- drm/msm/adreno: Fix SM6375 GPU ID +- accel/habanalabs/gaudi2: Fix incorrect string length computation in gaudi2_psoc_razwi_get_engines() +- drm/mediatek: Fix iommu fault during crtc enabling +- drm/mediatek: Fix iommu fault by swapping FBs after updating plane state +- drm/mediatek: Add mmsys_dev_num to mt8188 vdosys0 driver data +- io_uring/kbuf: Allow the full buffer id space for provided buffers +- io_uring/kbuf: Fix check of BID wrapping in provided buffers +- drm/amd/display: Bail from dm_check_crtc_cursor if no relevant change +- drm/amd/display: Refactor dm_get_plane_scale helper +- drm/amd/display: Check all enabled planes in dm_check_crtc_cursor +- drm/amd/display: Fix null pointer dereference in error message +- drm/amdkfd: Handle errors from svm validate and map +- drm/amdkfd: Remove svm range validated_once flag +- drm/amdkfd: fix some race conditions in vram buffer alloc/free of svm code +- drm/amdgpu: Increase IH soft ring size for GFX v9.4.3 dGPU +- drm: Call drm_atomic_helper_shutdown() at shutdown/remove time for misc drivers +- drm/bridge: tc358768: Fix tc358768_ns_to_cnt() +- drm/bridge: tc358768: Clean up clock period code +- drm/bridge: tc358768: Rename dsibclk to hsbyteclk +- drm/bridge: tc358768: Use dev for dbg prints, not priv->dev +- drm/bridge: tc358768: Print logical values, not raw register values +- drm/bridge: tc358768: Use struct videomode +- drm/bridge: tc358768: Fix bit updates +- drm/bridge: tc358768: Fix use of uninitialized variable +- x86/tdx: Zero out the missing RSI in TDX_HYPERCALL macro +- drm/mediatek: Fix coverity issue with unintentional integer overflow +- drm/ssd130x: Fix screen clearing +- drm/bridge: lt8912b: Add missing drm_bridge_attach call +- drm/bridge: lt8912b: Manually disable HPD only if it was enabled +- drm/bridge: lt8912b: Fix crash on bridge detach +- drm/bridge: lt8912b: Fix bridge_detach +- drm: bridge: it66121: Fix invalid connector dereference +- drm/radeon: Remove the references of radeon_gem_ pread & pwrite ioctls +- drm/radeon: possible buffer overflow +- drm/rockchip: vop2: Add missing call to crtc reset helper +- drm/rockchip: vop2: Don't crash for invalid duplicate_state +- drm/rockchip: vop: Fix call to crtc reset helper +- drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs +- drm/loongson: Fix error handling in lsdc_pixel_pll_setup() +- drm: bridge: samsung-dsim: Fix waiting for empty cmd transfer FIFO on older Exynos +- drm: bridge: for GENERIC_PHY_MIPI_DPHY also select GENERIC_PHY +- drm: bridge: samsung-dsim: Initialize ULPS EXIT for i.MX8M DSIM +- spi: omap2-mcspi: Fix hardcoded reference clock +- spi: omap2-mcspi: switch to use modern name +- platform/chrome: cros_ec_lpc: Separate host command and irq disable +- hte: tegra: Fix missing error code in tegra_hte_test_probe() +- hwmon: (sch5627) Disallow write access if virtual registers are locked +- hwmon: (sch5627) Use bit macros when accessing the control register +- hwmon: (pmbus/mp2975) Move PGOOD fix +- Revert "hwmon: (sch56xx-common) Add automatic module loading on supported devices" +- Revert "hwmon: (sch56xx-common) Add DMI override table" +- hwmon: (coretemp) Fix potentially truncated sysfs attribute name +- hwmon: (axi-fan-control) Fix possible NULL pointer dereference +- regulator: qcom-rpmh: Fix smps4 regulator for pm8550ve +- platform/x86: wmi: Fix opening of char device +- platform/x86: wmi: Fix probe failure when failing to register WMI devices +- clk: mediatek: fix double free in mtk_clk_register_pllfh() +- clk: qcom: ipq5332: drop the CLK_SET_RATE_PARENT flag from GPLL clocks +- clk: qcom: ipq9574: drop the CLK_SET_RATE_PARENT flag from GPLL clocks +- clk: qcom: ipq5018: drop the CLK_SET_RATE_PARENT flag from GPLL clocks +- clk: qcom: apss-ipq-pll: Fix 'l' value for ipq5332_pll_config +- clk: qcom: apss-ipq-pll: Use stromer plus ops for stromer plus pll +- clk: qcom: clk-alpha-pll: introduce stromer plus ops +- clk: qcom: config IPQ_APSS_6018 should depend on QCOM_SMEM +- clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data +- clk: mediatek: clk-mt7629: Add check for mtk_alloc_clk_data +- clk: mediatek: clk-mt7629-eth: Add check for mtk_alloc_clk_data +- clk: mediatek: clk-mt6797: Add check for mtk_alloc_clk_data +- clk: mediatek: clk-mt6779: Add check for mtk_alloc_clk_data +- clk: mediatek: clk-mt6765: Add check for mtk_alloc_clk_data +- clk: npcm7xx: Fix incorrect kfree +- clk: ti: fix double free in of_ti_divider_clk_setup() +- clk: keystone: pll: fix a couple NULL vs IS_ERR() checks +- clk: ralink: mtmips: quiet unused variable warning +- spi: nxp-fspi: use the correct ioremap function +- clk: linux/clk-provider.h: fix kernel-doc warnings and typos +- clk: renesas: rzg2l: Fix computation formula +- clk: renesas: rzg2l: Use FIELD_GET() for PLL register fields +- clk: renesas: rzg2l: Trust value returned by hardware +- clk: renesas: rzg2l: Lock around writes to mux register +- clk: renesas: rzg2l: Wait for status bit of SD mux before continuing +- clk: renesas: rcar-gen3: Extend SDnH divider table +- clk: imx: imx8qxp: Fix elcdif_pll clock +- clk: imx: imx8mq: correct error handling path +- clk: imx: imx8: Fix an error handling path in imx8_acm_clk_probe() +- clk: imx: imx8: Fix an error handling path if devm_clk_hw_register_mux_parent_data_table() fails +- clk: imx: imx8: Fix an error handling path in clk_imx_acm_attach_pm_domains() +- clk: imx: Select MXC_CLK for CLK_IMX8QXP +- regulator: mt6358: Fail probe on unknown chip ID +- gpio: sim: initialize a managed pointer when declaring it +- clk: qcom: gcc-sm8150: Fix gcc_sdcc2_apps_clk_src +- clk: qcom: mmcc-msm8998: Fix the SMMU GDSC +- clk: qcom: mmcc-msm8998: Don't check halt bit on some branch clks +- clk: qcom: clk-rcg2: Fix clock rate overflow for high parent frequencies +- clk: qcom: gcc-msm8996: Remove RPM bus clocks +- clk: qcom: ipq5332: Drop set rate parent from gpll0 dependent clocks +- spi: tegra: Fix missing IRQ check in tegra_slink_probe() +- regmap: debugfs: Fix a erroneous check after snprintf() +- ipvlan: properly track tx_errors +- net: add DEV_STATS_READ() helper +- virtio_net: use u64_stats_t infra to avoid data-races +- ipv6: avoid atomic fragment on GSO packets +- mptcp: properly account fastopen data +- ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() +- bpf: Fix unnecessary -EBUSY from htab_lock_bucket +- Bluetooth: hci_sync: Fix Opcode prints in bt_dev_dbg/err +- Bluetooth: Make handle of hci_conn be unique +- Bluetooth: ISO: Pass BIG encryption info through QoS +- wifi: iwlwifi: empty overflow queue during flush +- wifi: iwlwifi: mvm: update IGTK in mvmvif upon D3 resume +- wifi: iwlwifi: pcie: synchronize IRQs before NAPI +- wifi: iwlwifi: mvm: fix netif csum flags +- wifi: iwlwifi: increase number of RX buffers for EHT devices +- wifi: iwlwifi: mvm: remove TDLS stations from FW +- wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta() +- wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API +- wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface +- wifi: iwlwifi: mvm: Fix key flags for IGTK on AP interface +- wifi: iwlwifi: mvm: Correctly set link configuration +- wifi: iwlwifi: yoyo: swap cdb and jacket bits values +- wifi: mac80211: Fix setting vif links +- wifi: mac80211: don't recreate driver link debugfs in reconfig +- wifi: iwlwifi: mvm: use correct sta ID for IGTK/BIGTK +- wifi: iwlwifi: mvm: fix removing pasn station for responder +- wifi: iwlwifi: mvm: update station's MFP flag after association +- tcp: fix cookie_init_timestamp() overflows +- chtls: fix tp->rcv_tstamp initialization +- thermal: core: Don't update trip points inside the hysteresis range +- selftests/bpf: Make linked_list failure test more robust +- net: skb_find_text: Ignore patterns extending past 'to' +- bpf: Fix missed rcu read lock in bpf_task_under_cgroup() +- thermal/drivers/mediatek: Fix probe for THERMAL_V2 +- r8169: fix rare issue with broken rx after link-down on RTL8125 +- thermal: core: prevent potential string overflow +- wifi: rtw88: Remove duplicate NULL check before calling usb_kill/free_urb() +- virtio-net: fix the vq coalescing setting for vq resize +- virtio-net: fix per queue coalescing parameter setting +- virtio-net: consistently save parameters for per-queue +- virtio-net: fix mismatch of getting tx-frames +- netfilter: nf_tables: Drop pointless memset when dumping rules +- wifi: wfx: fix case where rates are out of order +- PM / devfreq: rockchip-dfi: Make pmu regmap mandatory +- can: dev: can_put_echo_skb(): don't crash kernel if can_priv::echo_skb is accessed out of bounds +- can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on() +- can: dev: can_restart(): don't crash kernel if carrier is OK +- wifi: ath11k: fix Tx power value during active CAC +- r8152: break the loop when the budget is exhausted +- selftests/bpf: Define SYS_NANOSLEEP_KPROBE_NAME for riscv +- selftests/bpf: Define SYS_PREFIX for riscv +- libbpf: Fix syscall access arguments on riscv +- can: etas_es58x: add missing a blank line after declaration +- can: etas_es58x: rework the version check logic to silence -Wformat-truncation +- ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100 +- ACPI: property: Allow _DSD buffer data only for byte accessors +- wifi: rtlwifi: fix EDCA limit set by BT coexistence +- tcp_metrics: do not create an entry from tcp_init_metrics() +- tcp_metrics: properly set tp->snd_ssthresh in tcp_init_metrics() +- tcp_metrics: add missing barriers on delete +- wifi: ath: dfs_pattern_detector: Fix a memory initialization issue +- wifi: mt76: mt7921: fix the wrong rate selected in fw for the chanctx driver +- wifi: mt76: mt7921: fix the wrong rate pickup for the chanctx driver +- wifi: mt76: move struct ieee80211_chanctx_conf up to struct mt76_vif +- wifi: mt76: mt7915: fix beamforming availability check +- wifi: mt76: fix per-band IEEE80211_CONF_MONITOR flag comparison +- wifi: mt76: get rid of false alamrs of tx emission issues +- wifi: mt76: fix potential memory leak of beacon commands +- wifi: mt76: update beacon size limitation +- wifi: mt76: mt7996: fix TWT command format +- wifi: mt76: mt7996: fix rx rate report for CBW320-2 +- wifi: mt76: mt7996: fix wmm queue mapping +- wifi: mt76: mt7996: fix beamformee ss subfield in EHT PHY cap +- wifi: mt76: mt7996: fix beamform mcu cmd configuration +- wifi: mt76: mt7996: set correct wcid in txp +- wifi: mt76: remove unused error path in mt76_connac_tx_complete_skb +- wifi: mt76: mt7603: improve stuck beacon handling +- wifi: mt76: mt7603: improve watchdog reset reliablity +- wifi: mt76: mt7603: rework/fix rx pse hang check +- cpufreq: tegra194: fix warning due to missing opp_put +- PM: sleep: Fix symbol export for _SIMPLE_ variants of _PM_OPS() +- wifi: mac80211: fix check for unusable RX result +- wifi: ath11k: fix boot failure with one MSI vector +- wifi: ath12k: fix DMA unmap warning on NULL DMA address +- wifi: rtw88: debug: Fix the NULL vs IS_ERR() bug for debugfs_create_file() +- net: ethernet: mtk_wed: fix EXT_INT_STATUS_RX_FBUF definitions for MT7986 SoC +- ice: fix pin assignment for E810-T without SMA control +- net: spider_net: Use size_add() in call to struct_size() +- tipc: Use size_add() in calls to struct_size() +- tls: Use size_add() in call to struct_size() +- mlxsw: Use size_mul() in call to struct_size() +- gve: Use size_add() in call to struct_size() +- bpf: Fix kfunc callback register type handling +- tcp: call tcp_try_undo_recovery when an RTOd TFO SYNACK is ACKed +- selftests/bpf: Skip module_fentry_shadow test when bpf_testmod is not available +- udplite: fix various data-races +- udplite: remove UDPLITE_BIT +- udp: annotate data-races around udp->encap_type +- udp: lockless UDP_ENCAP_L2TPINUDP / UDP_GRO +- udp: move udp->accept_udp_{l4|fraglist} to udp->udp_flags +- udp: add missing WRITE_ONCE() around up->encap_rcv +- udp: move udp->gro_enabled to udp->udp_flags +- udp: move udp->no_check6_rx to udp->udp_flags +- udp: move udp->no_check6_tx to udp->udp_flags +- udp: introduce udp->udp_flags +- wifi: cfg80211: fix kernel-doc for wiphy_delayed_work_flush() +- bpf, x64: Fix tailcall infinite loop +- selftests/bpf: Correct map_fd to data_fd in tailcalls +- iavf: Fix promiscuous mode configuration flow messages +- i40e: fix potential memory leaks in i40e_remove() +- wifi: iwlwifi: don't use an uninitialized variable +- wifi: iwlwifi: honor the enable_ini value +- wifi: mac80211: fix # of MSDU in A-MSDU calculation +- wifi: cfg80211: fix off-by-one in element defrag +- wifi: mac80211: fix RCU usage warning in mesh fast-xmit +- wifi: mac80211: move sched-scan stop work to wiphy work +- wifi: mac80211: move offchannel works to wiphy work +- wifi: mac80211: move scan work to wiphy work +- wifi: mac80211: move radar detect work to wiphy work +- wifi: cfg80211: add flush functions for wiphy work +- wifi: ath12k: fix undefined behavior with __fls in dp +- irqchip/sifive-plic: Fix syscore registration for multi-socket systems +- genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() +- string: Adjust strtomem() logic to allow for smaller sources +- PCI/MSI: Provide stubs for IMS functions +- selftests/x86/lam: Zero out buffer for readlink() +- perf: Optimize perf_cgroup_switch() +- pstore/platform: Add check for kstrdup +- x86/nmi: Fix out-of-order NMI nesting checks & false positive warning +- drivers/clocksource/timer-ti-dm: Don't call clk_get_rate() in stop function +- srcu: Fix callbacks acceleration mishandling +- x86/apic: Fake primary thread mask for XEN/PV +- cpu/SMT: Make SMT control more robust against enumeration failures +- x86/boot: Fix incorrect startup_gdt_descr.size +- x86/sev-es: Allow copy_from_kernel_nofault() in earlier boot +- cgroup/cpuset: Fix load balance state in update_partition_sd_lb() +- ACPI/NUMA: Apply SRAT proximity domain to entire CFMWS window +- x86/numa: Introduce numa_fill_memblks() +- futex: Don't include process MM in futex key on no-MMU +- x86/srso: Fix unret validation dependencies +- x86/srso: Fix vulnerability reporting for missing microcode +- x86/srso: Print mitigation for retbleed IBPB case +- x86/srso: Fix SBPB enablement for (possible) future fixed HW +- writeback, cgroup: switch inodes with dirty timestamps to release dying cgwbs +- vfs: fix readahead(2) on block devices +- nfsd: Handle EOPENSTALE correctly in the filecache +- sched: Fix stop_one_cpu_nowait() vs hotplug +- objtool: Propagate early errors +- sched/uclamp: Ignore (util == 0) optimization in feec() when p_util_max = 0 +- sched/uclamp: Set max_spare_cap_cpu even if max_spare_cap is 0 +- iov_iter, x86: Be consistent about the __user tag on copy_mc_to_user() +- sched/fair: Fix cfs_rq_is_decayed() on !SMP +- sched/topology: Fix sched_numa_find_nth_cpu() in non-NUMA case +- sched/topology: Fix sched_numa_find_nth_cpu() in CPU-less case +- numa: Generalize numa_map_to_online_node() +- hwmon: (nct6775) Fix incorrect variable reuse in fan_div calculation +- !2933 Backport linux 6.6.1 LTS patches +- ASoC: SOF: sof-pci-dev: Fix community key quirk detection +- ALSA: hda: intel-dsp-config: Fix JSL Chromebook quirk detection +- serial: core: Fix runtime PM handling for pending tx +- misc: pci_endpoint_test: Add deviceID for J721S2 PCIe EP device support +- dt-bindings: serial: rs485: Add rs485-rts-active-high +- tty: 8250: Add Brainboxes Oxford Semiconductor-based quirks +- tty: 8250: Add support for Intashield IX cards +- tty: 8250: Add support for additional Brainboxes PX cards +- tty: 8250: Fix up PX-803/PX-857 +- tty: 8250: Fix port count of PX-257 +- tty: 8250: Add support for Intashield IS-100 +- tty: 8250: Add support for Brainboxes UP cards +- tty: 8250: Add support for additional Brainboxes UC cards +- tty: 8250: Remove UC-257 and UC-431 +- tty: n_gsm: fix race condition in status line change on dead connections +- Bluetooth: hci_bcm4377: Mark bcm4378/bcm4387 as BROKEN_LE_CODED +- usb: raw-gadget: properly handle interrupted requests +- usb: typec: tcpm: Fix NULL pointer dereference in tcpm_pd_svdm() +- usb: typec: tcpm: Add additional checks for contaminant +- usb: storage: set 1.50 as the lower bcdDevice for older "Super Top" compatibility +- PCI: Prevent xHCI driver from claiming AMD VanGogh USB3 DRD device +- ALSA: usb-audio: add quirk flag to enable native DSD for McIntosh devices +- eventfs: Use simple_recursive_removal() to clean up dentries +- eventfs: Delete eventfs_inode when the last dentry is freed +- eventfs: Save ownership and mode +- eventfs: Remove "is_freed" union with rcu head +- tracing: Have trace_event_file have ref counters +- perf evlist: Avoid frequency mode for the dummy event +- power: supply: core: Use blocking_notifier_call_chain to avoid RCU complaint +- drm/amd/display: Don't use fsleep for PSR exit waits +- !2927 dm ioctl: add DMINFO() to track dm device create/remove +- dm ioctl: add DMINFO() to track dm device create/remove +- !2900 Add initial openeuler_defconfig for arm64 and x86 +- config: add initial openeuler_defconfig for x86 +- config: add initial openeuler_defconfig for arm64 +- kconfig: Add script to check & update openeuler_defconfig +- init from linux v6.6 diff --git a/patch-6.6.0-6.0.0-rt20.patch b/patch-6.6.0-6.0.0-rt20.patch new file mode 100644 index 0000000..75b22ef --- /dev/null +++ b/patch-6.6.0-6.0.0-rt20.patch @@ -0,0 +1,15642 @@ +From 6a8046066e4d49bf1ab1b8d80616cb60d021fa65 Mon Sep 17 00:00:00 2001 +From: zhangyu +Date: Fri, 10 May 2024 12:14:44 +0800 +Subject: [PATCH 1/2] rt + +--- + arch/arm/Kconfig | 4 +- + arch/arm/mm/fault.c | 6 + + arch/arm/vfp/vfpmodule.c | 74 +- + arch/arm64/Kconfig | 1 + + arch/powerpc/Kconfig | 2 + + arch/powerpc/include/asm/stackprotector.h | 7 +- + arch/powerpc/kernel/traps.c | 7 +- + arch/powerpc/kvm/Kconfig | 1 + + arch/powerpc/platforms/pseries/Kconfig | 1 + + arch/powerpc/platforms/pseries/iommu.c | 31 +- + arch/riscv/Kconfig | 2 + + arch/riscv/include/asm/cpufeature.h | 2 - + arch/riscv/include/asm/thread_info.h | 2 + + arch/riscv/kernel/cpufeature.c | 84 +- + arch/riscv/kernel/smpboot.c | 1 - + arch/x86/Kconfig | 2 + + arch/x86/include/asm/thread_info.h | 6 +- + drivers/acpi/processor_idle.c | 2 +- + drivers/block/zram/zram_drv.c | 37 + + drivers/block/zram/zram_drv.h | 3 + + .../gpu/drm/amd/display/amdgpu_dm/dc_fpu.c | 53 +- + .../drm/amd/display/dc/dcn20/dcn20_resource.c | 10 +- + .../drm/amd/display/dc/dcn21/dcn21_resource.c | 10 +- + .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 23 +- + .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.h | 10 +- + drivers/gpu/drm/i915/Kconfig | 1 - + drivers/gpu/drm/i915/display/intel_crtc.c | 15 +- + drivers/gpu/drm/i915/display/intel_vblank.c | 6 +- + drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 5 +- + .../drm/i915/gt/intel_execlists_submission.c | 17 +- + drivers/gpu/drm/i915/gt/intel_reset.c | 12 +- + drivers/gpu/drm/i915/gt/uc/intel_guc.h | 2 +- + drivers/gpu/drm/i915/i915_request.c | 2 - + drivers/gpu/drm/i915/i915_trace.h | 6 +- + drivers/gpu/drm/i915/i915_utils.h | 2 +- + drivers/tty/serial/21285.c | 8 +- + drivers/tty/serial/8250/8250_aspeed_vuart.c | 6 +- + drivers/tty/serial/8250/8250_bcm7271.c | 28 +- + drivers/tty/serial/8250/8250_core.c | 54 +- + drivers/tty/serial/8250/8250_dma.c | 8 +- + drivers/tty/serial/8250/8250_dw.c | 8 +- + drivers/tty/serial/8250/8250_exar.c | 4 +- + drivers/tty/serial/8250/8250_fsl.c | 6 +- + drivers/tty/serial/8250/8250_mtk.c | 8 +- + drivers/tty/serial/8250/8250_omap.c | 52 +- + drivers/tty/serial/8250/8250_pci1xxxx.c | 8 +- + drivers/tty/serial/8250/8250_port.c | 259 ++- + drivers/tty/serial/altera_jtaguart.c | 28 +- + drivers/tty/serial/altera_uart.c | 20 +- + drivers/tty/serial/amba-pl010.c | 20 +- + drivers/tty/serial/amba-pl011.c | 78 +- + drivers/tty/serial/apbuart.c | 8 +- + drivers/tty/serial/ar933x_uart.c | 26 +- + drivers/tty/serial/arc_uart.c | 16 +- + drivers/tty/serial/atmel_serial.c | 24 +- + drivers/tty/serial/bcm63xx_uart.c | 22 +- + drivers/tty/serial/cpm_uart.c | 8 +- + drivers/tty/serial/digicolor-usart.c | 18 +- + drivers/tty/serial/dz.c | 32 +- + drivers/tty/serial/fsl_linflexuart.c | 26 +- + drivers/tty/serial/fsl_lpuart.c | 88 +- + drivers/tty/serial/icom.c | 26 +- + drivers/tty/serial/imx.c | 84 +- + drivers/tty/serial/ip22zilog.c | 36 +- + drivers/tty/serial/jsm/jsm_neo.c | 4 +- + drivers/tty/serial/jsm/jsm_tty.c | 16 +- + drivers/tty/serial/liteuart.c | 20 +- + drivers/tty/serial/lpc32xx_hs.c | 26 +- + drivers/tty/serial/ma35d1_serial.c | 22 +- + drivers/tty/serial/mcf.c | 20 +- + drivers/tty/serial/men_z135_uart.c | 8 +- + drivers/tty/serial/meson_uart.c | 30 +- + drivers/tty/serial/milbeaut_usio.c | 16 +- + drivers/tty/serial/mpc52xx_uart.c | 12 +- + drivers/tty/serial/mps2-uart.c | 16 +- + drivers/tty/serial/msm_serial.c | 38 +- + drivers/tty/serial/mvebu-uart.c | 18 +- + drivers/tty/serial/omap-serial.c | 44 +- + drivers/tty/serial/owl-uart.c | 26 +- + drivers/tty/serial/pch_uart.c | 10 +- + drivers/tty/serial/pic32_uart.c | 20 +- + drivers/tty/serial/pmac_zilog.c | 52 +- + drivers/tty/serial/pxa.c | 30 +- + drivers/tty/serial/qcom_geni_serial.c | 8 +- + drivers/tty/serial/rda-uart.c | 34 +- + drivers/tty/serial/rp2.c | 20 +- + drivers/tty/serial/sa1100.c | 20 +- + drivers/tty/serial/samsung_tty.c | 50 +- + drivers/tty/serial/sb1250-duart.c | 12 +- + drivers/tty/serial/serial-tegra.c | 32 +- + drivers/tty/serial/serial_core.c | 92 +- + drivers/tty/serial/serial_mctrl_gpio.c | 4 +- + drivers/tty/serial/serial_port.c | 4 +- + drivers/tty/serial/serial_txx9.c | 26 +- + drivers/tty/serial/sh-sci.c | 68 +- + drivers/tty/serial/sifive.c | 16 +- + drivers/tty/serial/sprd_serial.c | 30 +- + drivers/tty/serial/st-asc.c | 18 +- + drivers/tty/serial/stm32-usart.c | 38 +- + drivers/tty/serial/sunhv.c | 28 +- + drivers/tty/serial/sunplus-uart.c | 26 +- + drivers/tty/serial/sunsab.c | 34 +- + drivers/tty/serial/sunsu.c | 46 +- + drivers/tty/serial/sunzilog.c | 42 +- + drivers/tty/serial/timbuart.c | 8 +- + drivers/tty/serial/uartlite.c | 18 +- + drivers/tty/serial/ucc_uart.c | 4 +- + drivers/tty/serial/vt8500_serial.c | 8 +- + drivers/tty/serial/xilinx_uartps.c | 56 +- + drivers/tty/tty_io.c | 11 +- + fs/proc/consoles.c | 14 +- + include/linux/bottom_half.h | 2 + + include/linux/console.h | 152 ++ + include/linux/entry-common.h | 2 +- + include/linux/entry-kvm.h | 2 +- + include/linux/interrupt.h | 29 + + include/linux/netdevice.h | 4 + + include/linux/preempt.h | 10 +- + include/linux/printk.h | 30 +- + include/linux/sched.h | 16 +- + include/linux/sched/idle.h | 8 +- + include/linux/sched/rt.h | 4 + + include/linux/serial_8250.h | 6 + + include/linux/serial_core.h | 44 +- + include/linux/thread_info.h | 24 + + include/linux/trace_events.h | 8 +- + kernel/Kconfig.preempt | 17 +- + kernel/entry/common.c | 4 +- + kernel/entry/kvm.c | 2 +- + kernel/futex/pi.c | 87 +- + kernel/futex/requeue.c | 6 +- + kernel/ksysfs.c | 12 + + kernel/locking/lockdep.c | 5 + + kernel/locking/rtmutex.c | 37 +- + kernel/locking/rwbase_rt.c | 8 + + kernel/locking/rwsem.c | 8 +- + kernel/locking/spinlock_rt.c | 6 + + kernel/locking/ww_rt_mutex.c | 2 +- + kernel/panic.c | 9 + + kernel/printk/Makefile | 2 +- + kernel/printk/internal.h | 121 ++ + kernel/printk/nbcon.c | 1664 +++++++++++++++++ + kernel/printk/printk.c | 751 ++++++-- + kernel/printk/printk_ringbuffer.c | 360 +++- + kernel/printk/printk_ringbuffer.h | 54 +- + kernel/printk/printk_safe.c | 12 + + kernel/rcu/rcutorture.c | 6 + + kernel/rcu/tree_stall.h | 5 + + kernel/sched/core.c | 127 +- + kernel/sched/debug.c | 19 + + kernel/sched/fair.c | 46 +- + kernel/sched/features.h | 1 + + kernel/sched/idle.c | 3 +- + kernel/sched/rt.c | 5 +- + kernel/sched/sched.h | 1 + + kernel/signal.c | 30 +- + kernel/softirq.c | 95 +- + kernel/time/hrtimer.c | 4 +- + kernel/time/tick-sched.c | 2 +- + kernel/time/timer.c | 11 +- + kernel/trace/trace.c | 2 + + kernel/trace/trace_output.c | 16 +- + net/core/dev.c | 39 +- + net/core/skbuff.c | 7 +- + 164 files changed, 5044 insertions(+), 1536 deletions(-) + create mode 100644 kernel/printk/nbcon.c + +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index 2483ce304..107ceeb96 100644 +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -34,6 +34,7 @@ config ARM + select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7 + select ARCH_SUPPORTS_ATOMIC_RMW + select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE ++ select ARCH_SUPPORTS_RT if HAVE_POSIX_CPU_TIMERS_TASK_WORK + select ARCH_USE_BUILTIN_BSWAP + select ARCH_USE_CMPXCHG_LOCKREF + select ARCH_USE_MEMTEST +@@ -73,7 +74,7 @@ config ARM + select HAS_IOPORT + select HAVE_ARCH_AUDITSYSCALL if AEABI && !OABI_COMPAT + select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6 +- select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU ++ select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU && !PREEMPT_RT + select HAVE_ARCH_KFENCE if MMU && !XIP_KERNEL + select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU + select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL +@@ -118,6 +119,7 @@ config ARM + select HAVE_PERF_EVENTS + select HAVE_PERF_REGS + select HAVE_PERF_USER_STACK_DUMP ++ select HAVE_POSIX_CPU_TIMERS_TASK_WORK if !KVM + select MMU_GATHER_RCU_TABLE_FREE if SMP && ARM_LPAE + select HAVE_REGS_AND_STACK_ACCESS_API + select HAVE_RSEQ +diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c +index fef62e4a9..622a30243 100644 +--- a/arch/arm/mm/fault.c ++++ b/arch/arm/mm/fault.c +@@ -404,6 +404,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, + if (addr < TASK_SIZE) + return do_page_fault(addr, fsr, regs); + ++ if (interrupts_enabled(regs)) ++ local_irq_enable(); ++ + if (user_mode(regs)) + goto bad_area; + +@@ -474,6 +477,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, + static int + do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) + { ++ if (interrupts_enabled(regs)) ++ local_irq_enable(); ++ + do_bad_area(addr, fsr, regs); + return 0; + } +diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c +index 7e8773a2d..9fde36fcb 100644 +--- a/arch/arm/vfp/vfpmodule.c ++++ b/arch/arm/vfp/vfpmodule.c +@@ -55,6 +55,34 @@ extern unsigned int VFP_arch_feroceon __alias(VFP_arch); + */ + union vfp_state *vfp_current_hw_state[NR_CPUS]; + ++/* ++ * Claim ownership of the VFP unit. ++ * ++ * The caller may change VFP registers until vfp_unlock() is called. ++ * ++ * local_bh_disable() is used to disable preemption and to disable VFP ++ * processing in softirq context. On PREEMPT_RT kernels local_bh_disable() is ++ * not sufficient because it only serializes soft interrupt related sections ++ * via a local lock, but stays preemptible. Disabling preemption is the right ++ * choice here as bottom half processing is always in thread context on RT ++ * kernels so it implicitly prevents bottom half processing as well. ++ */ ++static void vfp_lock(void) ++{ ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_bh_disable(); ++ else ++ preempt_disable(); ++} ++ ++static void vfp_unlock(void) ++{ ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_bh_enable(); ++ else ++ preempt_enable(); ++} ++ + /* + * Is 'thread's most up to date state stored in this CPUs hardware? + * Must be called from non-preemptible context. +@@ -240,7 +268,7 @@ static void vfp_panic(char *reason, u32 inst) + /* + * Process bitmask of exception conditions. + */ +-static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_regs *regs) ++static int vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr) + { + int si_code = 0; + +@@ -248,8 +276,7 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_ + + if (exceptions == VFP_EXCEPTION_ERROR) { + vfp_panic("unhandled bounce", inst); +- vfp_raise_sigfpe(FPE_FLTINV, regs); +- return; ++ return FPE_FLTINV; + } + + /* +@@ -277,8 +304,7 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_ + RAISE(FPSCR_OFC, FPSCR_OFE, FPE_FLTOVF); + RAISE(FPSCR_IOC, FPSCR_IOE, FPE_FLTINV); + +- if (si_code) +- vfp_raise_sigfpe(si_code, regs); ++ return si_code; + } + + /* +@@ -324,6 +350,8 @@ static u32 vfp_emulate_instruction(u32 inst, u32 fpscr, struct pt_regs *regs) + static void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) + { + u32 fpscr, orig_fpscr, fpsid, exceptions; ++ int si_code2 = 0; ++ int si_code = 0; + + pr_debug("VFP: bounce: trigger %08x fpexc %08x\n", trigger, fpexc); + +@@ -369,8 +397,8 @@ static void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) + * unallocated VFP instruction but with FPSCR.IXE set and not + * on VFP subarch 1. + */ +- vfp_raise_exceptions(VFP_EXCEPTION_ERROR, trigger, fpscr, regs); +- return; ++ si_code = vfp_raise_exceptions(VFP_EXCEPTION_ERROR, trigger, fpscr); ++ goto exit; + } + + /* +@@ -394,14 +422,14 @@ static void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) + */ + exceptions = vfp_emulate_instruction(trigger, fpscr, regs); + if (exceptions) +- vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs); ++ si_code2 = vfp_raise_exceptions(exceptions, trigger, orig_fpscr); + + /* + * If there isn't a second FP instruction, exit now. Note that + * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1. + */ + if ((fpexc & (FPEXC_EX | FPEXC_FP2V)) != (FPEXC_EX | FPEXC_FP2V)) +- return; ++ goto exit; + + /* + * The barrier() here prevents fpinst2 being read +@@ -413,7 +441,13 @@ static void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) + emulate: + exceptions = vfp_emulate_instruction(trigger, orig_fpscr, regs); + if (exceptions) +- vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs); ++ si_code = vfp_raise_exceptions(exceptions, trigger, orig_fpscr); ++exit: ++ vfp_unlock(); ++ if (si_code2) ++ vfp_raise_sigfpe(si_code2, regs); ++ if (si_code) ++ vfp_raise_sigfpe(si_code, regs); + } + + static void vfp_enable(void *unused) +@@ -512,11 +546,9 @@ static inline void vfp_pm_init(void) { } + */ + void vfp_sync_hwstate(struct thread_info *thread) + { +- unsigned int cpu = get_cpu(); ++ vfp_lock(); + +- local_bh_disable(); +- +- if (vfp_state_in_hw(cpu, thread)) { ++ if (vfp_state_in_hw(raw_smp_processor_id(), thread)) { + u32 fpexc = fmrx(FPEXC); + + /* +@@ -527,8 +559,7 @@ void vfp_sync_hwstate(struct thread_info *thread) + fmxr(FPEXC, fpexc); + } + +- local_bh_enable(); +- put_cpu(); ++ vfp_unlock(); + } + + /* Ensure that the thread reloads the hardware VFP state on the next use. */ +@@ -683,7 +714,7 @@ static int vfp_support_entry(struct pt_regs *regs, u32 trigger) + if (!user_mode(regs)) + return vfp_kmode_exception(regs, trigger); + +- local_bh_disable(); ++ vfp_lock(); + fpexc = fmrx(FPEXC); + + /* +@@ -748,6 +779,7 @@ static int vfp_support_entry(struct pt_regs *regs, u32 trigger) + * replay the instruction that trapped. + */ + fmxr(FPEXC, fpexc); ++ vfp_unlock(); + } else { + /* Check for synchronous or asynchronous exceptions */ + if (!(fpexc & (FPEXC_EX | FPEXC_DEX))) { +@@ -762,17 +794,17 @@ static int vfp_support_entry(struct pt_regs *regs, u32 trigger) + if (!(fpscr & FPSCR_IXE)) { + if (!(fpscr & FPSCR_LENGTH_MASK)) { + pr_debug("not VFP\n"); +- local_bh_enable(); ++ vfp_unlock(); + return -ENOEXEC; + } + fpexc |= FPEXC_DEX; + } + } + bounce: regs->ARM_pc += 4; ++ /* VFP_bounce() will invoke vfp_unlock() */ + VFP_bounce(trigger, fpexc, regs); + } + +- local_bh_enable(); + return 0; + } + +@@ -819,7 +851,7 @@ void kernel_neon_begin(void) + unsigned int cpu; + u32 fpexc; + +- local_bh_disable(); ++ vfp_lock(); + + /* + * Kernel mode NEON is only allowed outside of hardirq context with +@@ -850,7 +882,7 @@ void kernel_neon_end(void) + { + /* Disable the NEON/VFP unit. */ + fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); +- local_bh_enable(); ++ vfp_unlock(); + } + EXPORT_SYMBOL(kernel_neon_end); + +diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig +index fc56e4e30..805bf6ece 100644 +--- a/arch/arm64/Kconfig ++++ b/arch/arm64/Kconfig +@@ -98,6 +98,7 @@ config ARM64 + select ARCH_SUPPORTS_NUMA_BALANCING + select ARCH_SUPPORTS_PAGE_TABLE_CHECK + select ARCH_SUPPORTS_PER_VMA_LOCK ++ select ARCH_SUPPORTS_RT + select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH + select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT + select ARCH_WANT_DEFAULT_BPF_JIT +diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig +index 37fbb5fc3..9a7d3d054 100644 +--- a/arch/powerpc/Kconfig ++++ b/arch/powerpc/Kconfig +@@ -166,6 +166,7 @@ config PPC + select ARCH_STACKWALK + select ARCH_SUPPORTS_ATOMIC_RMW + select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx || 40x ++ select ARCH_SUPPORTS_RT if HAVE_POSIX_CPU_TIMERS_TASK_WORK + select ARCH_USE_BUILTIN_BSWAP + select ARCH_USE_CMPXCHG_LOCKREF if PPC64 + select ARCH_USE_MEMTEST +@@ -269,6 +270,7 @@ config PPC + select HAVE_PERF_USER_STACK_DUMP + select HAVE_REGS_AND_STACK_ACCESS_API + select HAVE_RELIABLE_STACKTRACE ++ select HAVE_POSIX_CPU_TIMERS_TASK_WORK if !KVM + select HAVE_RSEQ + select HAVE_SETUP_PER_CPU_AREA if PPC64 + select HAVE_SOFTIRQ_ON_OWN_STACK +diff --git a/arch/powerpc/include/asm/stackprotector.h b/arch/powerpc/include/asm/stackprotector.h +index 283c34647..4727f4005 100644 +--- a/arch/powerpc/include/asm/stackprotector.h ++++ b/arch/powerpc/include/asm/stackprotector.h +@@ -19,8 +19,13 @@ + */ + static __always_inline void boot_init_stack_canary(void) + { +- unsigned long canary = get_random_canary(); ++ unsigned long canary; + ++#ifndef CONFIG_PREEMPT_RT ++ canary = get_random_canary(); ++#else ++ canary = ((unsigned long)&canary) & CANARY_MASK; ++#endif + current->stack_canary = canary; + #ifdef CONFIG_PPC64 + get_paca()->canary = canary; +diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c +index f0c07b79a..4c03b1ea2 100644 +--- a/arch/powerpc/kernel/traps.c ++++ b/arch/powerpc/kernel/traps.c +@@ -265,12 +265,17 @@ static char *get_mmu_str(void) + + static int __die(const char *str, struct pt_regs *regs, long err) + { ++ const char *pr = ""; ++ + printk("Oops: %s, sig: %ld [#%d]\n", str, err, ++die_counter); + ++ if (IS_ENABLED(CONFIG_PREEMPTION)) ++ pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT"; ++ + printk("%s PAGE_SIZE=%luK%s%s%s%s%s%s %s\n", + IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE", + PAGE_SIZE / 1024, get_mmu_str(), +- IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "", ++ pr, + IS_ENABLED(CONFIG_SMP) ? " SMP" : "", + IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "", + debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "", +diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig +index 902611954..2f188137f 100644 +--- a/arch/powerpc/kvm/Kconfig ++++ b/arch/powerpc/kvm/Kconfig +@@ -224,6 +224,7 @@ config KVM_E500MC + config KVM_MPIC + bool "KVM in-kernel MPIC emulation" + depends on KVM && PPC_E500 ++ depends on !PREEMPT_RT + select HAVE_KVM_IRQCHIP + select HAVE_KVM_IRQFD + select HAVE_KVM_IRQ_ROUTING +diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig +index 4ebf2ef28..381c3be3b 100644 +--- a/arch/powerpc/platforms/pseries/Kconfig ++++ b/arch/powerpc/platforms/pseries/Kconfig +@@ -2,6 +2,7 @@ + config PPC_PSERIES + depends on PPC64 && PPC_BOOK3S + bool "IBM pSeries & new (POWER5-based) iSeries" ++ select GENERIC_ALLOCATOR + select HAVE_PCSPKR_PLATFORM + select MPIC + select OF_DYNAMIC +diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c +index e8c412969..c61e29dea 100644 +--- a/arch/powerpc/platforms/pseries/iommu.c ++++ b/arch/powerpc/platforms/pseries/iommu.c +@@ -25,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -206,7 +207,13 @@ static int tce_build_pSeriesLP(unsigned long liobn, long tcenum, long tceshift, + return ret; + } + +-static DEFINE_PER_CPU(__be64 *, tce_page); ++struct tce_page { ++ __be64 * page; ++ local_lock_t lock; ++}; ++static DEFINE_PER_CPU(struct tce_page, tce_page) = { ++ .lock = INIT_LOCAL_LOCK(lock), ++}; + + static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, + long npages, unsigned long uaddr, +@@ -229,9 +236,10 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, + direction, attrs); + } + +- local_irq_save(flags); /* to protect tcep and the page behind it */ ++ /* to protect tcep and the page behind it */ ++ local_lock_irqsave(&tce_page.lock, flags); + +- tcep = __this_cpu_read(tce_page); ++ tcep = __this_cpu_read(tce_page.page); + + /* This is safe to do since interrupts are off when we're called + * from iommu_alloc{,_sg}() +@@ -240,12 +248,12 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, + tcep = (__be64 *)__get_free_page(GFP_ATOMIC); + /* If allocation fails, fall back to the loop implementation */ + if (!tcep) { +- local_irq_restore(flags); ++ local_unlock_irqrestore(&tce_page.lock, flags); + return tce_build_pSeriesLP(tbl->it_index, tcenum, + tceshift, + npages, uaddr, direction, attrs); + } +- __this_cpu_write(tce_page, tcep); ++ __this_cpu_write(tce_page.page, tcep); + } + + rpn = __pa(uaddr) >> tceshift; +@@ -275,7 +283,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum, + tcenum += limit; + } while (npages > 0 && !rc); + +- local_irq_restore(flags); ++ local_unlock_irqrestore(&tce_page.lock, flags); + + if (unlikely(rc == H_NOT_ENOUGH_RESOURCES)) { + ret = (int)rc; +@@ -459,16 +467,17 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn, + DMA_BIDIRECTIONAL, 0); + } + +- local_irq_disable(); /* to protect tcep and the page behind it */ +- tcep = __this_cpu_read(tce_page); ++ /* to protect tcep and the page behind it */ ++ local_lock_irq(&tce_page.lock); ++ tcep = __this_cpu_read(tce_page.page); + + if (!tcep) { + tcep = (__be64 *)__get_free_page(GFP_ATOMIC); + if (!tcep) { +- local_irq_enable(); ++ local_unlock_irq(&tce_page.lock); + return -ENOMEM; + } +- __this_cpu_write(tce_page, tcep); ++ __this_cpu_write(tce_page.page, tcep); + } + + proto_tce = TCE_PCI_READ | TCE_PCI_WRITE; +@@ -511,7 +520,7 @@ static int tce_setrange_multi_pSeriesLP(unsigned long start_pfn, + + /* error cleanup: caller will clear whole range */ + +- local_irq_enable(); ++ local_unlock_irq(&tce_page.lock); + return rc; + } + +diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig +index f439aa2a0..b342d0679 100644 +--- a/arch/riscv/Kconfig ++++ b/arch/riscv/Kconfig +@@ -48,6 +48,7 @@ config RISCV + select ARCH_SUPPORTS_HUGETLBFS if MMU + select ARCH_SUPPORTS_PAGE_TABLE_CHECK if MMU + select ARCH_SUPPORTS_PER_VMA_LOCK if MMU ++ select ARCH_SUPPORTS_RT + select ARCH_USE_MEMTEST + select ARCH_USE_QUEUED_RWLOCKS + select ARCH_USES_CFI_TRAPS if CFI_CLANG +@@ -136,6 +137,7 @@ config RISCV + select HAVE_PERF_USER_STACK_DUMP + select HAVE_POSIX_CPU_TIMERS_TASK_WORK + select HAVE_PREEMPT_DYNAMIC_KEY if !XIP_KERNEL ++ select HAVE_PREEMPT_AUTO + select HAVE_REGS_AND_STACK_ACCESS_API + select HAVE_RETHOOK if !XIP_KERNEL + select HAVE_RSEQ +diff --git a/arch/riscv/include/asm/cpufeature.h b/arch/riscv/include/asm/cpufeature.h +index d0345bd65..23fed53b8 100644 +--- a/arch/riscv/include/asm/cpufeature.h ++++ b/arch/riscv/include/asm/cpufeature.h +@@ -30,6 +30,4 @@ DECLARE_PER_CPU(long, misaligned_access_speed); + /* Per-cpu ISA extensions. */ + extern struct riscv_isainfo hart_isa[NR_CPUS]; + +-void check_unaligned_access(int cpu); +- + #endif +diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h +index d18ce0113..e18710fe5 100644 +--- a/arch/riscv/include/asm/thread_info.h ++++ b/arch/riscv/include/asm/thread_info.h +@@ -82,6 +82,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); + * - pending work-to-be-done flags are in lowest half-word + * - other flags in upper half-word(s) + */ ++#define TIF_ARCH_RESCHED_LAZY 0 /* Lazy rescheduling */ + #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ + #define TIF_SIGPENDING 2 /* signal pending */ + #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ +@@ -96,6 +97,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); + #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) + #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) + #define _TIF_UPROBE (1 << TIF_UPROBE) ++#define _TIF_ARCH_RESCHED_LAZY (1 << TIF_ARCH_RESCHED_LAZY) + + #define _TIF_WORK_MASK \ + (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED | \ +diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c +index e39a905ac..9d8b6b463 100644 +--- a/arch/riscv/kernel/cpufeature.c ++++ b/arch/riscv/kernel/cpufeature.c +@@ -8,6 +8,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -30,6 +31,7 @@ + + #define MISALIGNED_ACCESS_JIFFIES_LG2 1 + #define MISALIGNED_BUFFER_SIZE 0x4000 ++#define MISALIGNED_BUFFER_ORDER get_order(MISALIGNED_BUFFER_SIZE) + #define MISALIGNED_COPY_SIZE ((MISALIGNED_BUFFER_SIZE / 2) - 0x80) + + unsigned long elf_hwcap __read_mostly; +@@ -571,14 +573,15 @@ unsigned long riscv_get_elf_hwcap(void) + return hwcap; + } + +-void check_unaligned_access(int cpu) ++static int check_unaligned_access(void *param) + { ++ int cpu = smp_processor_id(); + u64 start_cycles, end_cycles; + u64 word_cycles; + u64 byte_cycles; + int ratio; + unsigned long start_jiffies, now; +- struct page *page; ++ struct page *page = param; + void *dst; + void *src; + long speed = RISCV_HWPROBE_MISALIGNED_SLOW; +@@ -645,7 +648,7 @@ void check_unaligned_access(int cpu) + pr_warn("cpu%d: rdtime lacks granularity needed to measure unaligned access speed\n", + cpu); + +- goto out; ++ return 0; + } + + if (word_cycles < byte_cycles) +@@ -659,18 +662,83 @@ void check_unaligned_access(int cpu) + (speed == RISCV_HWPROBE_MISALIGNED_FAST) ? "fast" : "slow"); + + per_cpu(misaligned_access_speed, cpu) = speed; ++ return 0; ++} + +-out: +- __free_pages(page, get_order(MISALIGNED_BUFFER_SIZE)); ++static void check_unaligned_access_nonboot_cpu(void *param) ++{ ++ unsigned int cpu = smp_processor_id(); ++ struct page **pages = param; ++ ++ if (smp_processor_id() != 0) ++ check_unaligned_access(pages[cpu]); ++} ++ ++static int riscv_online_cpu(unsigned int cpu) ++{ ++ static struct page *buf; ++ ++ /* We are already set since the last check */ ++ if (per_cpu(misaligned_access_speed, cpu) != RISCV_HWPROBE_MISALIGNED_UNKNOWN) ++ return 0; ++ ++ buf = alloc_pages(GFP_KERNEL, MISALIGNED_BUFFER_ORDER); ++ if (!buf) { ++ pr_warn("Allocation failure, not measuring misaligned performance\n"); ++ return -ENOMEM; ++ } ++ ++ check_unaligned_access(buf); ++ __free_pages(buf, MISALIGNED_BUFFER_ORDER); ++ return 0; + } + +-static int check_unaligned_access_boot_cpu(void) ++/* Measure unaligned access on all CPUs present at boot in parallel. */ ++static int check_unaligned_access_all_cpus(void) + { +- check_unaligned_access(0); ++ unsigned int cpu; ++ unsigned int cpu_count = num_possible_cpus(); ++ struct page **bufs = kzalloc(cpu_count * sizeof(struct page *), ++ GFP_KERNEL); ++ ++ if (!bufs) { ++ pr_warn("Allocation failure, not measuring misaligned performance\n"); ++ return 0; ++ } ++ ++ /* ++ * Allocate separate buffers for each CPU so there's no fighting over ++ * cache lines. ++ */ ++ for_each_cpu(cpu, cpu_online_mask) { ++ bufs[cpu] = alloc_pages(GFP_KERNEL, MISALIGNED_BUFFER_ORDER); ++ if (!bufs[cpu]) { ++ pr_warn("Allocation failure, not measuring misaligned performance\n"); ++ goto out; ++ } ++ } ++ ++ /* Check everybody except 0, who stays behind to tend jiffies. */ ++ on_each_cpu(check_unaligned_access_nonboot_cpu, bufs, 1); ++ ++ /* Check core 0. */ ++ smp_call_on_cpu(0, check_unaligned_access, bufs[0], true); ++ ++ /* Setup hotplug callback for any new CPUs that come online. */ ++ cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "riscv:online", ++ riscv_online_cpu, NULL); ++ ++out: ++ for_each_cpu(cpu, cpu_online_mask) { ++ if (bufs[cpu]) ++ __free_pages(bufs[cpu], MISALIGNED_BUFFER_ORDER); ++ } ++ ++ kfree(bufs); + return 0; + } + +-arch_initcall(check_unaligned_access_boot_cpu); ++arch_initcall(check_unaligned_access_all_cpus); + + #ifdef CONFIG_RISCV_ALTERNATIVE + /* +diff --git a/arch/riscv/kernel/smpboot.c b/arch/riscv/kernel/smpboot.c +index 1b8da4e40..2cb5e6514 100644 +--- a/arch/riscv/kernel/smpboot.c ++++ b/arch/riscv/kernel/smpboot.c +@@ -246,7 +246,6 @@ asmlinkage __visible void smp_callin(void) + + numa_add_cpu(curr_cpuid); + set_cpu_online(curr_cpuid, 1); +- check_unaligned_access(curr_cpuid); + + if (has_vector()) { + if (riscv_v_setup_vsize()) +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index a993a3716..aa7ab6207 100644 +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -121,6 +121,7 @@ config X86 + select ARCH_USES_CFI_TRAPS if X86_64 && CFI_CLANG + select ARCH_SUPPORTS_LTO_CLANG + select ARCH_SUPPORTS_LTO_CLANG_THIN ++ select ARCH_SUPPORTS_RT + select ARCH_USE_BUILTIN_BSWAP + select ARCH_USE_MEMTEST + select ARCH_USE_QUEUED_RWLOCKS +@@ -277,6 +278,7 @@ config X86 + select HAVE_STATIC_CALL + select HAVE_STATIC_CALL_INLINE if HAVE_OBJTOOL + select HAVE_PREEMPT_DYNAMIC_CALL ++ select HAVE_PREEMPT_AUTO + select HAVE_RSEQ + select HAVE_RUST if X86_64 + select HAVE_SYSCALL_TRACEPOINTS +diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h +index 971a05326..d176fa5d0 100644 +--- a/arch/x86/include/asm/thread_info.h ++++ b/arch/x86/include/asm/thread_info.h +@@ -85,8 +85,9 @@ struct thread_info { + #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ + #define TIF_SIGPENDING 2 /* signal pending */ + #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ +-#define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/ +-#define TIF_SSBD 5 /* Speculative store bypass disable */ ++#define TIF_ARCH_RESCHED_LAZY 4 /* Lazy rescheduling */ ++#define TIF_SINGLESTEP 5 /* reenable singlestep on user return*/ ++#define TIF_SSBD 6 /* Speculative store bypass disable */ + #define TIF_SPEC_IB 9 /* Indirect branch speculation mitigation */ + #define TIF_SPEC_L1D_FLUSH 10 /* Flush L1D on mm switches (processes) */ + #define TIF_USER_RETURN_NOTIFY 11 /* notify kernel of userspace return */ +@@ -108,6 +109,7 @@ struct thread_info { + #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) + #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) + #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) ++#define _TIF_ARCH_RESCHED_LAZY (1 << TIF_ARCH_RESCHED_LAZY) + #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) + #define _TIF_SSBD (1 << TIF_SSBD) + #define _TIF_SPEC_IB (1 << TIF_SPEC_IB) +diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c +index bd6a7857c..d45dfd10b 100644 +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -108,7 +108,7 @@ static const struct dmi_system_id processor_power_dmi_table[] = { + */ + static void __cpuidle acpi_safe_halt(void) + { +- if (!tif_need_resched()) { ++ if (!need_resched()) { + raw_safe_halt(); + raw_local_irq_disable(); + } +diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c +index d77d3664c..d083a5dfb 100644 +--- a/drivers/block/zram/zram_drv.c ++++ b/drivers/block/zram/zram_drv.c +@@ -57,6 +57,41 @@ static void zram_free_page(struct zram *zram, size_t index); + static int zram_read_page(struct zram *zram, struct page *page, u32 index, + struct bio *parent); + ++#ifdef CONFIG_PREEMPT_RT ++static void zram_meta_init_table_locks(struct zram *zram, size_t num_pages) ++{ ++ size_t index; ++ ++ for (index = 0; index < num_pages; index++) ++ spin_lock_init(&zram->table[index].lock); ++} ++ ++static int zram_slot_trylock(struct zram *zram, u32 index) ++{ ++ int ret; ++ ++ ret = spin_trylock(&zram->table[index].lock); ++ if (ret) ++ __set_bit(ZRAM_LOCK, &zram->table[index].flags); ++ return ret; ++} ++ ++static void zram_slot_lock(struct zram *zram, u32 index) ++{ ++ spin_lock(&zram->table[index].lock); ++ __set_bit(ZRAM_LOCK, &zram->table[index].flags); ++} ++ ++static void zram_slot_unlock(struct zram *zram, u32 index) ++{ ++ __clear_bit(ZRAM_LOCK, &zram->table[index].flags); ++ spin_unlock(&zram->table[index].lock); ++} ++ ++#else ++ ++static void zram_meta_init_table_locks(struct zram *zram, size_t num_pages) { } ++ + static int zram_slot_trylock(struct zram *zram, u32 index) + { + return bit_spin_trylock(ZRAM_LOCK, &zram->table[index].flags); +@@ -71,6 +106,7 @@ static void zram_slot_unlock(struct zram *zram, u32 index) + { + bit_spin_unlock(ZRAM_LOCK, &zram->table[index].flags); + } ++#endif + + static inline bool init_done(struct zram *zram) + { +@@ -1242,6 +1278,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) + + if (!huge_class_size) + huge_class_size = zs_huge_class_size(zram->mem_pool); ++ zram_meta_init_table_locks(zram, num_pages); + return true; + } + +diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h +index d090753f9..833abc17d 100644 +--- a/drivers/block/zram/zram_drv.h ++++ b/drivers/block/zram/zram_drv.h +@@ -69,6 +69,9 @@ struct zram_table_entry { + unsigned long element; + }; + unsigned long flags; ++#ifdef CONFIG_PREEMPT_RT ++ spinlock_t lock; ++#endif + #ifdef CONFIG_ZRAM_MEMORY_TRACKING + ktime_t ac_time; + #endif +diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c +index 172aa10a8..4ae472053 100644 +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/dc_fpu.c +@@ -60,11 +60,9 @@ static DEFINE_PER_CPU(int, fpu_recursion_depth); + */ + inline void dc_assert_fp_enabled(void) + { +- int *pcpu, depth = 0; ++ int depth; + +- pcpu = get_cpu_ptr(&fpu_recursion_depth); +- depth = *pcpu; +- put_cpu_ptr(&fpu_recursion_depth); ++ depth = __this_cpu_read(fpu_recursion_depth); + + ASSERT(depth >= 1); + } +@@ -84,33 +82,28 @@ inline void dc_assert_fp_enabled(void) + */ + void dc_fpu_begin(const char *function_name, const int line) + { +- int *pcpu; ++ int depth; + +- pcpu = get_cpu_ptr(&fpu_recursion_depth); +- *pcpu += 1; ++ WARN_ON_ONCE(!in_task()); ++ preempt_disable(); ++ depth = __this_cpu_inc_return(fpu_recursion_depth); + +- if (*pcpu == 1) { ++ if (depth == 1) { + #if defined(CONFIG_X86) || defined(CONFIG_LOONGARCH) +- migrate_disable(); + kernel_fpu_begin(); + #elif defined(CONFIG_PPC64) +- if (cpu_has_feature(CPU_FTR_VSX_COMP)) { +- preempt_disable(); ++ if (cpu_has_feature(CPU_FTR_VSX_COMP)) + enable_kernel_vsx(); +- } else if (cpu_has_feature(CPU_FTR_ALTIVEC_COMP)) { +- preempt_disable(); ++ else if (cpu_has_feature(CPU_FTR_ALTIVEC_COMP)) + enable_kernel_altivec(); +- } else if (!cpu_has_feature(CPU_FTR_FPU_UNAVAILABLE)) { +- preempt_disable(); ++ else if (!cpu_has_feature(CPU_FTR_FPU_UNAVAILABLE)) + enable_kernel_fp(); +- } + #elif defined(CONFIG_ARM64) + kernel_neon_begin(); + #endif + } + +- TRACE_DCN_FPU(true, function_name, line, *pcpu); +- put_cpu_ptr(&fpu_recursion_depth); ++ TRACE_DCN_FPU(true, function_name, line, depth); + } + + /** +@@ -125,30 +118,26 @@ void dc_fpu_begin(const char *function_name, const int line) + */ + void dc_fpu_end(const char *function_name, const int line) + { +- int *pcpu; ++ int depth; + +- pcpu = get_cpu_ptr(&fpu_recursion_depth); +- *pcpu -= 1; +- if (*pcpu <= 0) { ++ depth = __this_cpu_dec_return(fpu_recursion_depth); ++ if (depth == 0) { + #if defined(CONFIG_X86) || defined(CONFIG_LOONGARCH) + kernel_fpu_end(); +- migrate_enable(); + #elif defined(CONFIG_PPC64) +- if (cpu_has_feature(CPU_FTR_VSX_COMP)) { ++ if (cpu_has_feature(CPU_FTR_VSX_COMP)) + disable_kernel_vsx(); +- preempt_enable(); +- } else if (cpu_has_feature(CPU_FTR_ALTIVEC_COMP)) { ++ else if (cpu_has_feature(CPU_FTR_ALTIVEC_COMP)) + disable_kernel_altivec(); +- preempt_enable(); +- } else if (!cpu_has_feature(CPU_FTR_FPU_UNAVAILABLE)) { ++ else if (!cpu_has_feature(CPU_FTR_FPU_UNAVAILABLE)) + disable_kernel_fp(); +- preempt_enable(); +- } + #elif defined(CONFIG_ARM64) + kernel_neon_end(); + #endif ++ } else { ++ WARN_ON_ONCE(depth < 0); + } + +- TRACE_DCN_FPU(false, function_name, line, *pcpu); +- put_cpu_ptr(&fpu_recursion_depth); ++ TRACE_DCN_FPU(false, function_name, line, depth); ++ preempt_enable(); + } +diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +index d587f807d..5036a3e60 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +@@ -2141,9 +2141,17 @@ bool dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context, + bool fast_validate) + { + bool voltage_supported; ++ display_e2e_pipe_params_st *pipes; ++ ++ pipes = kcalloc(dc->res_pool->pipe_count, sizeof(display_e2e_pipe_params_st), GFP_KERNEL); ++ if (!pipes) ++ return false; ++ + DC_FP_START(); +- voltage_supported = dcn20_validate_bandwidth_fp(dc, context, fast_validate); ++ voltage_supported = dcn20_validate_bandwidth_fp(dc, context, fast_validate, pipes); + DC_FP_END(); ++ ++ kfree(pipes); + return voltage_supported; + } + +diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +index d1a25fe6c..5674c3450 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +@@ -953,9 +953,17 @@ static bool dcn21_validate_bandwidth(struct dc *dc, struct dc_state *context, + bool fast_validate) + { + bool voltage_supported; ++ display_e2e_pipe_params_st *pipes; ++ ++ pipes = kcalloc(dc->res_pool->pipe_count, sizeof(display_e2e_pipe_params_st), GFP_KERNEL); ++ if (!pipes) ++ return false; ++ + DC_FP_START(); +- voltage_supported = dcn21_validate_bandwidth_fp(dc, context, fast_validate); ++ voltage_supported = dcn21_validate_bandwidth_fp(dc, context, fast_validate, pipes); + DC_FP_END(); ++ ++ kfree(pipes); + return voltage_supported; + } + +diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +index 8a5a038fd..68970d6cf 100644 +--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c ++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +@@ -2018,7 +2018,7 @@ void dcn20_patch_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st + } + + static bool dcn20_validate_bandwidth_internal(struct dc *dc, struct dc_state *context, +- bool fast_validate) ++ bool fast_validate, display_e2e_pipe_params_st *pipes) + { + bool out = false; + +@@ -2027,7 +2027,6 @@ static bool dcn20_validate_bandwidth_internal(struct dc *dc, struct dc_state *co + int vlevel = 0; + int pipe_split_from[MAX_PIPES]; + int pipe_cnt = 0; +- display_e2e_pipe_params_st *pipes = kzalloc(dc->res_pool->pipe_count * sizeof(display_e2e_pipe_params_st), GFP_ATOMIC); + DC_LOGGER_INIT(dc->ctx->logger); + + BW_VAL_TRACE_COUNT(); +@@ -2062,16 +2061,14 @@ static bool dcn20_validate_bandwidth_internal(struct dc *dc, struct dc_state *co + out = false; + + validate_out: +- kfree(pipes); + + BW_VAL_TRACE_FINISH(); + + return out; + } + +-bool dcn20_validate_bandwidth_fp(struct dc *dc, +- struct dc_state *context, +- bool fast_validate) ++bool dcn20_validate_bandwidth_fp(struct dc *dc, struct dc_state *context, ++ bool fast_validate, display_e2e_pipe_params_st *pipes) + { + bool voltage_supported = false; + bool full_pstate_supported = false; +@@ -2090,11 +2087,11 @@ bool dcn20_validate_bandwidth_fp(struct dc *dc, + ASSERT(context != dc->current_state); + + if (fast_validate) { +- return dcn20_validate_bandwidth_internal(dc, context, true); ++ return dcn20_validate_bandwidth_internal(dc, context, true, pipes); + } + + // Best case, we support full UCLK switch latency +- voltage_supported = dcn20_validate_bandwidth_internal(dc, context, false); ++ voltage_supported = dcn20_validate_bandwidth_internal(dc, context, false, pipes); + full_pstate_supported = context->bw_ctx.bw.dcn.clk.p_state_change_support; + + if (context->bw_ctx.dml.soc.dummy_pstate_latency_us == 0 || +@@ -2106,7 +2103,8 @@ bool dcn20_validate_bandwidth_fp(struct dc *dc, + // Fallback: Try to only support G6 temperature read latency + context->bw_ctx.dml.soc.dram_clock_change_latency_us = context->bw_ctx.dml.soc.dummy_pstate_latency_us; + +- voltage_supported = dcn20_validate_bandwidth_internal(dc, context, false); ++ memset(pipes, 0, dc->res_pool->pipe_count * sizeof(display_e2e_pipe_params_st)); ++ voltage_supported = dcn20_validate_bandwidth_internal(dc, context, false, pipes); + dummy_pstate_supported = context->bw_ctx.bw.dcn.clk.p_state_change_support; + + if (voltage_supported && (dummy_pstate_supported || !(context->stream_count))) { +@@ -2311,9 +2309,8 @@ static void dcn21_calculate_wm(struct dc *dc, struct dc_state *context, + &context->bw_ctx.dml, pipes, pipe_cnt); + } + +-bool dcn21_validate_bandwidth_fp(struct dc *dc, +- struct dc_state *context, +- bool fast_validate) ++bool dcn21_validate_bandwidth_fp(struct dc *dc, struct dc_state *context, ++ bool fast_validate, display_e2e_pipe_params_st *pipes) + { + bool out = false; + +@@ -2322,7 +2319,6 @@ bool dcn21_validate_bandwidth_fp(struct dc *dc, + int vlevel = 0; + int pipe_split_from[MAX_PIPES]; + int pipe_cnt = 0; +- display_e2e_pipe_params_st *pipes = kzalloc(dc->res_pool->pipe_count * sizeof(display_e2e_pipe_params_st), GFP_ATOMIC); + DC_LOGGER_INIT(dc->ctx->logger); + + BW_VAL_TRACE_COUNT(); +@@ -2362,7 +2358,6 @@ bool dcn21_validate_bandwidth_fp(struct dc *dc, + out = false; + + validate_out: +- kfree(pipes); + + BW_VAL_TRACE_FINISH(); + +diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.h b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.h +index c51badf7b..b6c34198d 100644 +--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.h ++++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.h +@@ -61,9 +61,8 @@ void dcn20_update_bounding_box(struct dc *dc, + unsigned int num_states); + void dcn20_patch_bounding_box(struct dc *dc, + struct _vcs_dpi_soc_bounding_box_st *bb); +-bool dcn20_validate_bandwidth_fp(struct dc *dc, +- struct dc_state *context, +- bool fast_validate); ++bool dcn20_validate_bandwidth_fp(struct dc *dc, struct dc_state *context, ++ bool fast_validate, display_e2e_pipe_params_st *pipes); + void dcn20_fpu_set_wm_ranges(int i, + struct pp_smu_wm_range_sets *ranges, + struct _vcs_dpi_soc_bounding_box_st *loaded_bb); +@@ -77,9 +76,8 @@ int dcn21_populate_dml_pipes_from_context(struct dc *dc, + struct dc_state *context, + display_e2e_pipe_params_st *pipes, + bool fast_validate); +-bool dcn21_validate_bandwidth_fp(struct dc *dc, +- struct dc_state *context, +- bool fast_validate); ++bool dcn21_validate_bandwidth_fp(struct dc *dc, struct dc_state *context, bool ++ fast_validate, display_e2e_pipe_params_st *pipes); + void dcn21_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params); + + void dcn21_clk_mgr_set_bw_params_wm_table(struct clk_bw_params *bw_params); +diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig +index ce397a879..98c3f5328 100644 +--- a/drivers/gpu/drm/i915/Kconfig ++++ b/drivers/gpu/drm/i915/Kconfig +@@ -3,7 +3,6 @@ config DRM_I915 + tristate "Intel 8xx/9xx/G3x/G4x/HD Graphics" + depends on DRM + depends on X86 && PCI +- depends on !PREEMPT_RT + select INTEL_GTT if X86 + select INTERVAL_TREE + # we need shmfs for the swappable backing store, and in particular +diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c +index cfbfbfed3..da2becfbc 100644 +--- a/drivers/gpu/drm/i915/display/intel_crtc.c ++++ b/drivers/gpu/drm/i915/display/intel_crtc.c +@@ -562,7 +562,8 @@ void intel_pipe_update_start(struct intel_atomic_state *state, + */ + intel_psr_wait_for_idle_locked(new_crtc_state); + +- local_irq_disable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_irq_disable(); + + crtc->debug.min_vbl = min; + crtc->debug.max_vbl = max; +@@ -587,11 +588,13 @@ void intel_pipe_update_start(struct intel_atomic_state *state, + break; + } + +- local_irq_enable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_irq_enable(); + + timeout = schedule_timeout(timeout); + +- local_irq_disable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_irq_disable(); + } + + finish_wait(wq, &wait); +@@ -624,7 +627,8 @@ void intel_pipe_update_start(struct intel_atomic_state *state, + return; + + irq_disable: +- local_irq_disable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_irq_disable(); + } + + #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_VBLANK_EVADE) +@@ -728,7 +732,8 @@ void intel_pipe_update_end(struct intel_atomic_state *state, + */ + intel_vrr_send_push(new_crtc_state); + +- local_irq_enable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ local_irq_enable(); + + if (intel_vgpu_active(dev_priv)) + return; +diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c +index f5659ebd0..5b6d2f555 100644 +--- a/drivers/gpu/drm/i915/display/intel_vblank.c ++++ b/drivers/gpu/drm/i915/display/intel_vblank.c +@@ -294,7 +294,8 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, + */ + spin_lock_irqsave(&dev_priv->uncore.lock, irqflags); + +- /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ ++ if (IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_disable(); + + /* Get optional system timestamp before query. */ + if (stime) +@@ -358,7 +359,8 @@ static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, + if (etime) + *etime = ktime_get(); + +- /* preempt_enable_rt() should go right here in PREEMPT_RT patchset. */ ++ if (IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_enable(); + + spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); + +diff --git a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c +index ecc990ec1..8d04b1068 100644 +--- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c ++++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c +@@ -312,10 +312,9 @@ void __intel_breadcrumbs_park(struct intel_breadcrumbs *b) + /* Kick the work once more to drain the signalers, and disarm the irq */ + irq_work_sync(&b->irq_work); + while (READ_ONCE(b->irq_armed) && !atomic_read(&b->active)) { +- local_irq_disable(); +- signal_irq_work(&b->irq_work); +- local_irq_enable(); ++ irq_work_queue(&b->irq_work); + cond_resched(); ++ irq_work_sync(&b->irq_work); + } + } + +diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +index 42e09f158..ac80e229f 100644 +--- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c ++++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c +@@ -1303,7 +1303,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) + * and context switches) submission. + */ + +- spin_lock(&sched_engine->lock); ++ spin_lock_irq(&sched_engine->lock); + + /* + * If the queue is higher priority than the last +@@ -1403,7 +1403,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) + * Even if ELSP[1] is occupied and not worthy + * of timeslices, our queue might be. + */ +- spin_unlock(&sched_engine->lock); ++ spin_unlock_irq(&sched_engine->lock); + return; + } + } +@@ -1429,7 +1429,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) + + if (last && !can_merge_rq(last, rq)) { + spin_unlock(&ve->base.sched_engine->lock); +- spin_unlock(&engine->sched_engine->lock); ++ spin_unlock_irq(&engine->sched_engine->lock); + return; /* leave this for another sibling */ + } + +@@ -1591,7 +1591,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine) + */ + sched_engine->queue_priority_hint = queue_prio(sched_engine); + i915_sched_engine_reset_on_empty(sched_engine); +- spin_unlock(&sched_engine->lock); ++ spin_unlock_irq(&sched_engine->lock); + + /* + * We can skip poking the HW if we ended up with exactly the same set +@@ -1617,13 +1617,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine) + } + } + +-static void execlists_dequeue_irq(struct intel_engine_cs *engine) +-{ +- local_irq_disable(); /* Suspend interrupts across request submission */ +- execlists_dequeue(engine); +- local_irq_enable(); /* flush irq_work (e.g. breadcrumb enabling) */ +-} +- + static void clear_ports(struct i915_request **ports, int count) + { + memset_p((void **)ports, NULL, count); +@@ -2478,7 +2471,7 @@ static void execlists_submission_tasklet(struct tasklet_struct *t) + } + + if (!engine->execlists.pending[0]) { +- execlists_dequeue_irq(engine); ++ execlists_dequeue(engine); + start_timeslice(engine); + } + +diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c +index 13fb8e504..b51fb0c97 100644 +--- a/drivers/gpu/drm/i915/gt/intel_reset.c ++++ b/drivers/gpu/drm/i915/gt/intel_reset.c +@@ -164,13 +164,13 @@ static int i915_do_reset(struct intel_gt *gt, + /* Assert reset for at least 20 usec, and wait for acknowledgement. */ + pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE); + udelay(50); +- err = wait_for_atomic(i915_in_reset(pdev), 50); ++ err = _wait_for_atomic(i915_in_reset(pdev), 50, 0); + + /* Clear the reset request. */ + pci_write_config_byte(pdev, I915_GDRST, 0); + udelay(50); + if (!err) +- err = wait_for_atomic(!i915_in_reset(pdev), 50); ++ err = _wait_for_atomic(!i915_in_reset(pdev), 50, 0); + + return err; + } +@@ -190,7 +190,7 @@ static int g33_do_reset(struct intel_gt *gt, + struct pci_dev *pdev = to_pci_dev(gt->i915->drm.dev); + + pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE); +- return wait_for_atomic(g4x_reset_complete(pdev), 50); ++ return _wait_for_atomic(g4x_reset_complete(pdev), 50, 0); + } + + static int g4x_do_reset(struct intel_gt *gt, +@@ -207,7 +207,7 @@ static int g4x_do_reset(struct intel_gt *gt, + + pci_write_config_byte(pdev, I915_GDRST, + GRDOM_MEDIA | GRDOM_RESET_ENABLE); +- ret = wait_for_atomic(g4x_reset_complete(pdev), 50); ++ ret = _wait_for_atomic(g4x_reset_complete(pdev), 50, 0); + if (ret) { + GT_TRACE(gt, "Wait for media reset failed\n"); + goto out; +@@ -215,7 +215,7 @@ static int g4x_do_reset(struct intel_gt *gt, + + pci_write_config_byte(pdev, I915_GDRST, + GRDOM_RENDER | GRDOM_RESET_ENABLE); +- ret = wait_for_atomic(g4x_reset_complete(pdev), 50); ++ ret = _wait_for_atomic(g4x_reset_complete(pdev), 50, 0); + if (ret) { + GT_TRACE(gt, "Wait for render reset failed\n"); + goto out; +@@ -785,9 +785,7 @@ int __intel_gt_reset(struct intel_gt *gt, intel_engine_mask_t engine_mask) + reset_mask = wa_14015076503_start(gt, engine_mask, !retry); + + GT_TRACE(gt, "engine_mask=%x\n", reset_mask); +- preempt_disable(); + ret = reset(gt, reset_mask, retry); +- preempt_enable(); + + wa_14015076503_end(gt, reset_mask); + } +diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h +index 8dc291ff0..5b8d084c9 100644 +--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h ++++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h +@@ -317,7 +317,7 @@ static inline int intel_guc_send_busy_loop(struct intel_guc *guc, + { + int err; + unsigned int sleep_period_ms = 1; +- bool not_atomic = !in_atomic() && !irqs_disabled(); ++ bool not_atomic = !in_atomic() && !irqs_disabled() && !rcu_preempt_depth(); + + /* + * FIXME: Have caller pass in if we are in an atomic context to avoid +diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c +index f59081066..014d02029 100644 +--- a/drivers/gpu/drm/i915/i915_request.c ++++ b/drivers/gpu/drm/i915/i915_request.c +@@ -609,7 +609,6 @@ bool __i915_request_submit(struct i915_request *request) + + RQ_TRACE(request, "\n"); + +- GEM_BUG_ON(!irqs_disabled()); + lockdep_assert_held(&engine->sched_engine->lock); + + /* +@@ -718,7 +717,6 @@ void __i915_request_unsubmit(struct i915_request *request) + */ + RQ_TRACE(request, "\n"); + +- GEM_BUG_ON(!irqs_disabled()); + lockdep_assert_held(&engine->sched_engine->lock); + + /* +diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h +index ce1cbee1b..3c51620d0 100644 +--- a/drivers/gpu/drm/i915/i915_trace.h ++++ b/drivers/gpu/drm/i915/i915_trace.h +@@ -6,6 +6,10 @@ + #if !defined(_I915_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) + #define _I915_TRACE_H_ + ++#ifdef CONFIG_PREEMPT_RT ++#define NOTRACE ++#endif ++ + #include + #include + #include +@@ -322,7 +326,7 @@ DEFINE_EVENT(i915_request, i915_request_add, + TP_ARGS(rq) + ); + +-#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS) ++#if defined(CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS) && !defined(NOTRACE) + DEFINE_EVENT(i915_request, i915_request_guc_submit, + TP_PROTO(struct i915_request *rq), + TP_ARGS(rq) +diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h +index c61066498..48e19e55d 100644 +--- a/drivers/gpu/drm/i915/i915_utils.h ++++ b/drivers/gpu/drm/i915/i915_utils.h +@@ -288,7 +288,7 @@ wait_remaining_ms_from_jiffies(unsigned long timestamp_jiffies, int to_wait_ms) + #define wait_for(COND, MS) _wait_for((COND), (MS) * 1000, 10, 1000) + + /* If CONFIG_PREEMPT_COUNT is disabled, in_atomic() always reports false. */ +-#if defined(CONFIG_DRM_I915_DEBUG) && defined(CONFIG_PREEMPT_COUNT) ++#if defined(CONFIG_DRM_I915_DEBUG) && defined(CONFIG_PREEMPT_COUNT) && !defined(CONFIG_PREEMPT_RT) + # define _WAIT_FOR_ATOMIC_CHECK(ATOMIC) WARN_ON_ONCE((ATOMIC) && !in_atomic()) + #else + # define _WAIT_FOR_ATOMIC_CHECK(ATOMIC) do { } while (0) +diff --git a/drivers/tty/serial/21285.c b/drivers/tty/serial/21285.c +index d756fcc88..4de0c975e 100644 +--- a/drivers/tty/serial/21285.c ++++ b/drivers/tty/serial/21285.c +@@ -185,14 +185,14 @@ static void serial21285_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + unsigned int h_lcr; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + h_lcr = *CSR_H_UBRLCR; + if (break_state) + h_lcr |= H_UBRLCR_BREAK; + else + h_lcr &= ~H_UBRLCR_BREAK; + *CSR_H_UBRLCR = h_lcr; +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int serial21285_startup(struct uart_port *port) +@@ -272,7 +272,7 @@ serial21285_set_termios(struct uart_port *port, struct ktermios *termios, + if (port->fifosize) + h_lcr |= H_UBRLCR_FIFO; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* + * Update the per-port timeout. +@@ -309,7 +309,7 @@ serial21285_set_termios(struct uart_port *port, struct ktermios *termios, + *CSR_H_UBRLCR = h_lcr; + *CSR_UARTCON = 1; + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *serial21285_type(struct uart_port *port) +diff --git a/drivers/tty/serial/8250/8250_aspeed_vuart.c b/drivers/tty/serial/8250/8250_aspeed_vuart.c +index 4a9e71b2d..021949f25 100644 +--- a/drivers/tty/serial/8250/8250_aspeed_vuart.c ++++ b/drivers/tty/serial/8250/8250_aspeed_vuart.c +@@ -288,9 +288,9 @@ static void aspeed_vuart_set_throttle(struct uart_port *port, bool throttle) + struct uart_8250_port *up = up_to_u8250p(port); + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + __aspeed_vuart_set_throttle(up, throttle); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void aspeed_vuart_throttle(struct uart_port *port) +@@ -340,7 +340,7 @@ static int aspeed_vuart_handle_irq(struct uart_port *port) + if (iir & UART_IIR_NO_INT) + return 0; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + lsr = serial_port_in(port, UART_LSR); + +diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c +index aa5aff046..ff0662c68 100644 +--- a/drivers/tty/serial/8250/8250_bcm7271.c ++++ b/drivers/tty/serial/8250/8250_bcm7271.c +@@ -567,7 +567,7 @@ static irqreturn_t brcmuart_isr(int irq, void *dev_id) + if (interrupts == 0) + return IRQ_NONE; + +- spin_lock_irqsave(&up->lock, flags); ++ uart_port_lock_irqsave(up, &flags); + + /* Clear all interrupts */ + udma_writel(priv, REGS_DMA_ISR, UDMA_INTR_CLEAR, interrupts); +@@ -581,7 +581,7 @@ static irqreturn_t brcmuart_isr(int irq, void *dev_id) + if ((rval | tval) == 0) + dev_warn(dev, "Spurious interrupt: 0x%x\n", interrupts); + +- spin_unlock_irqrestore(&up->lock, flags); ++ uart_port_unlock_irqrestore(up, flags); + return IRQ_HANDLED; + } + +@@ -608,10 +608,10 @@ static int brcmuart_startup(struct uart_port *port) + * + * Synchronize UART_IER access against the console. + */ +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + up->ier &= ~UART_IER_RDI; + serial_port_out(port, UART_IER, up->ier); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + + priv->tx_running = false; + priv->dma.rx_dma = NULL; +@@ -629,7 +629,7 @@ static void brcmuart_shutdown(struct uart_port *port) + struct brcmuart_priv *priv = up->port.private_data; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + priv->shutdown = true; + if (priv->dma_enabled) { + stop_rx_dma(up); +@@ -645,7 +645,7 @@ static void brcmuart_shutdown(struct uart_port *port) + */ + up->dma = NULL; + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + serial8250_do_shutdown(port); + } + +@@ -788,7 +788,7 @@ static int brcmuart_handle_irq(struct uart_port *p) + * interrupt but there is no data ready. + */ + if (((iir & UART_IIR_ID) == UART_IIR_RX_TIMEOUT) && !(priv->shutdown)) { +- spin_lock_irqsave(&p->lock, flags); ++ uart_port_lock_irqsave(p, &flags); + status = serial_port_in(p, UART_LSR); + if ((status & UART_LSR_DR) == 0) { + +@@ -813,7 +813,7 @@ static int brcmuart_handle_irq(struct uart_port *p) + + handled = 1; + } +- spin_unlock_irqrestore(&p->lock, flags); ++ uart_port_unlock_irqrestore(p, flags); + if (handled) + return 1; + } +@@ -831,7 +831,7 @@ static enum hrtimer_restart brcmuart_hrtimer_func(struct hrtimer *t) + if (priv->shutdown) + return HRTIMER_NORESTART; + +- spin_lock_irqsave(&p->lock, flags); ++ uart_port_lock_irqsave(p, &flags); + status = serial_port_in(p, UART_LSR); + + /* +@@ -855,7 +855,7 @@ static enum hrtimer_restart brcmuart_hrtimer_func(struct hrtimer *t) + status |= UART_MCR_RTS; + serial_port_out(p, UART_MCR, status); + } +- spin_unlock_irqrestore(&p->lock, flags); ++ uart_port_unlock_irqrestore(p, flags); + return HRTIMER_NORESTART; + } + +@@ -1154,10 +1154,10 @@ static int __maybe_unused brcmuart_suspend(struct device *dev) + * This will prevent resume from enabling RTS before the + * baud rate has been restored. + */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + priv->saved_mctrl = port->mctrl; + port->mctrl &= ~TIOCM_RTS; +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + serial8250_suspend_port(priv->line); + clk_disable_unprepare(priv->baud_mux_clk); +@@ -1196,10 +1196,10 @@ static int __maybe_unused brcmuart_resume(struct device *dev) + + if (priv->saved_mctrl & TIOCM_RTS) { + /* Restore RTS */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + port->mctrl |= TIOCM_RTS; + port->ops->set_mctrl(port, port->mctrl); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + return 0; +diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c +index 3449f8790..30434718f 100644 +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c +@@ -259,7 +259,7 @@ static void serial8250_backup_timeout(struct timer_list *t) + unsigned int iir, ier = 0, lsr; + unsigned long flags; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* + * Must disable interrupts or else we risk racing with the interrupt +@@ -292,7 +292,7 @@ static void serial8250_backup_timeout(struct timer_list *t) + if (up->port.irq) + serial_out(up, UART_IER, ier); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + /* Standard timer interval plus 0.2s to keep the port running */ + mod_timer(&up->timer, +@@ -592,6 +592,7 @@ serial8250_register_ports(struct uart_driver *drv, struct device *dev) + + #ifdef CONFIG_SERIAL_8250_CONSOLE + ++#ifdef CONFIG_SERIAL_8250_LEGACY_CONSOLE + static void univ8250_console_write(struct console *co, const char *s, + unsigned int count) + { +@@ -599,6 +600,37 @@ static void univ8250_console_write(struct console *co, const char *s, + + serial8250_console_write(up, s, count); + } ++#else ++static bool univ8250_console_write_atomic(struct console *co, ++ struct nbcon_write_context *wctxt) ++{ ++ struct uart_8250_port *up = &serial8250_ports[co->index]; ++ ++ return serial8250_console_write_atomic(up, wctxt); ++} ++ ++static bool univ8250_console_write_thread(struct console *co, ++ struct nbcon_write_context *wctxt) ++{ ++ struct uart_8250_port *up = &serial8250_ports[co->index]; ++ ++ return serial8250_console_write_thread(up, wctxt); ++} ++ ++static void univ8250_console_driver_enter(struct console *con, unsigned long *flags) ++{ ++ struct uart_port *up = &serial8250_ports[con->index].port; ++ ++ __uart_port_lock_irqsave(up, flags); ++} ++ ++static void univ8250_console_driver_exit(struct console *con, unsigned long flags) ++{ ++ struct uart_port *up = &serial8250_ports[con->index].port; ++ ++ __uart_port_unlock_irqrestore(up, flags); ++} ++#endif /* CONFIG_SERIAL_8250_LEGACY_CONSOLE */ + + static int univ8250_console_setup(struct console *co, char *options) + { +@@ -698,12 +730,20 @@ static int univ8250_console_match(struct console *co, char *name, int idx, + + static struct console univ8250_console = { + .name = "ttyS", ++#ifdef CONFIG_SERIAL_8250_LEGACY_CONSOLE + .write = univ8250_console_write, ++ .flags = CON_PRINTBUFFER | CON_ANYTIME, ++#else ++ .write_atomic = univ8250_console_write_atomic, ++ .write_thread = univ8250_console_write_thread, ++ .driver_enter = univ8250_console_driver_enter, ++ .driver_exit = univ8250_console_driver_exit, ++ .flags = CON_PRINTBUFFER | CON_ANYTIME | CON_NBCON, ++#endif + .device = uart_console_device, + .setup = univ8250_console_setup, + .exit = univ8250_console_exit, + .match = univ8250_console_match, +- .flags = CON_PRINTBUFFER | CON_ANYTIME, + .index = -1, + .data = &serial8250_reg, + }; +@@ -992,11 +1032,11 @@ static void serial_8250_overrun_backoff_work(struct work_struct *work) + struct uart_port *port = &up->port; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + up->ier |= UART_IER_RLSI | UART_IER_RDI; + up->port.read_status_mask |= UART_LSR_DR; + serial_out(up, UART_IER, up->ier); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /** +@@ -1194,9 +1234,9 @@ void serial8250_unregister_port(int line) + if (uart->em485) { + unsigned long flags; + +- spin_lock_irqsave(&uart->port.lock, flags); ++ uart_port_lock_irqsave(&uart->port, &flags); + serial8250_em485_destroy(uart); +- spin_unlock_irqrestore(&uart->port.lock, flags); ++ uart_port_unlock_irqrestore(&uart->port, flags); + } + + uart_remove_one_port(&serial8250_reg, &uart->port); +diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c +index 7fa665017..8b30ca8fd 100644 +--- a/drivers/tty/serial/8250/8250_dma.c ++++ b/drivers/tty/serial/8250/8250_dma.c +@@ -22,7 +22,7 @@ static void __dma_tx_complete(void *param) + dma_sync_single_for_cpu(dma->txchan->device->dev, dma->tx_addr, + UART_XMIT_SIZE, DMA_TO_DEVICE); + +- spin_lock_irqsave(&p->port.lock, flags); ++ uart_port_lock_irqsave(&p->port, &flags); + + dma->tx_running = 0; + +@@ -35,7 +35,7 @@ static void __dma_tx_complete(void *param) + if (ret || !dma->tx_running) + serial8250_set_THRI(p); + +- spin_unlock_irqrestore(&p->port.lock, flags); ++ uart_port_unlock_irqrestore(&p->port, flags); + } + + static void __dma_rx_complete(struct uart_8250_port *p) +@@ -70,7 +70,7 @@ static void dma_rx_complete(void *param) + struct uart_8250_dma *dma = p->dma; + unsigned long flags; + +- spin_lock_irqsave(&p->port.lock, flags); ++ uart_port_lock_irqsave(&p->port, &flags); + if (dma->rx_running) + __dma_rx_complete(p); + +@@ -80,7 +80,7 @@ static void dma_rx_complete(void *param) + */ + if (!dma->rx_running && (serial_lsr_in(p) & UART_LSR_DR)) + p->dma->rx_dma(p); +- spin_unlock_irqrestore(&p->port.lock, flags); ++ uart_port_unlock_irqrestore(&p->port, flags); + } + + int serial8250_tx_dma(struct uart_8250_port *p) +diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c +index a1f2259cc..53c284bb2 100644 +--- a/drivers/tty/serial/8250/8250_dw.c ++++ b/drivers/tty/serial/8250/8250_dw.c +@@ -263,20 +263,20 @@ static int dw8250_handle_irq(struct uart_port *p) + * so we limit the workaround only to non-DMA mode. + */ + if (!up->dma && rx_timeout) { +- spin_lock_irqsave(&p->lock, flags); ++ uart_port_lock_irqsave(p, &flags); + status = serial_lsr_in(up); + + if (!(status & (UART_LSR_DR | UART_LSR_BI))) + (void) p->serial_in(p, UART_RX); + +- spin_unlock_irqrestore(&p->lock, flags); ++ uart_port_unlock_irqrestore(p, flags); + } + + /* Manually stop the Rx DMA transfer when acting as flow controller */ + if (quirks & DW_UART_QUIRK_IS_DMA_FC && up->dma && up->dma->rx_running && rx_timeout) { +- spin_lock_irqsave(&p->lock, flags); ++ uart_port_lock_irqsave(p, &flags); + status = serial_lsr_in(up); +- spin_unlock_irqrestore(&p->lock, flags); ++ uart_port_unlock_irqrestore(p, flags); + + if (status & (UART_LSR_DR | UART_LSR_BI)) { + dw8250_writel_ext(p, RZN1_UART_RDMACR, 0); +diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c +index 4d20f3aa2..342786064 100644 +--- a/drivers/tty/serial/8250/8250_exar.c ++++ b/drivers/tty/serial/8250/8250_exar.c +@@ -201,9 +201,9 @@ static int xr17v35x_startup(struct uart_port *port) + * + * Synchronize UART_IER access against the console. + */ +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + serial_port_out(port, UART_IER, 0); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + + return serial8250_do_startup(port); + } +diff --git a/drivers/tty/serial/8250/8250_fsl.c b/drivers/tty/serial/8250/8250_fsl.c +index 6af4e1c12..f522eb502 100644 +--- a/drivers/tty/serial/8250/8250_fsl.c ++++ b/drivers/tty/serial/8250/8250_fsl.c +@@ -30,11 +30,11 @@ int fsl8250_handle_irq(struct uart_port *port) + unsigned int iir; + struct uart_8250_port *up = up_to_u8250p(port); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + iir = port->serial_in(port, UART_IIR); + if (iir & UART_IIR_NO_INT) { +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + return 0; + } + +@@ -54,7 +54,7 @@ int fsl8250_handle_irq(struct uart_port *port) + if (unlikely(up->lsr_saved_flags & UART_LSR_BI)) { + up->lsr_saved_flags &= ~UART_LSR_BI; + port->serial_in(port, UART_RX); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + return 1; + } + +diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c +index 74da5676c..23457daae 100644 +--- a/drivers/tty/serial/8250/8250_mtk.c ++++ b/drivers/tty/serial/8250/8250_mtk.c +@@ -102,7 +102,7 @@ static void mtk8250_dma_rx_complete(void *param) + if (data->rx_status == DMA_RX_SHUTDOWN) + return; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + dmaengine_tx_status(dma->rxchan, dma->rx_cookie, &state); + total = dma->rx_size - state.residue; +@@ -128,7 +128,7 @@ static void mtk8250_dma_rx_complete(void *param) + + mtk8250_rx_dma(up); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static void mtk8250_rx_dma(struct uart_8250_port *up) +@@ -368,7 +368,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, + * Ok, we're now changing the port state. Do it with + * interrupts disabled. + */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* + * Update the per-port timeout. +@@ -416,7 +416,7 @@ mtk8250_set_termios(struct uart_port *port, struct ktermios *termios, + if (uart_console(port)) + up->port.cons->cflag = termios->c_cflag; + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + /* Don't rewrite B0 */ + if (tty_termios_baud_rate(termios)) + tty_termios_encode_baud_rate(termios, baud, baud); +diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c +index 346167afe..db5519ce0 100644 +--- a/drivers/tty/serial/8250/8250_omap.c ++++ b/drivers/tty/serial/8250/8250_omap.c +@@ -401,7 +401,7 @@ static void omap_8250_set_termios(struct uart_port *port, + * interrupts disabled. + */ + pm_runtime_get_sync(port->dev); +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + + /* + * Update the per-port timeout. +@@ -504,7 +504,7 @@ static void omap_8250_set_termios(struct uart_port *port, + } + omap8250_restore_regs(up); + +- spin_unlock_irq(&up->port.lock); ++ uart_port_unlock_irq(&up->port); + pm_runtime_mark_last_busy(port->dev); + pm_runtime_put_autosuspend(port->dev); + +@@ -529,7 +529,7 @@ static void omap_8250_pm(struct uart_port *port, unsigned int state, + pm_runtime_get_sync(port->dev); + + /* Synchronize UART_IER access against the console. */ +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + + serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); + efr = serial_in(up, UART_EFR); +@@ -541,7 +541,7 @@ static void omap_8250_pm(struct uart_port *port, unsigned int state, + serial_out(up, UART_EFR, efr); + serial_out(up, UART_LCR, 0); + +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + + pm_runtime_mark_last_busy(port->dev); + pm_runtime_put_autosuspend(port->dev); +@@ -660,7 +660,7 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) + unsigned long delay; + + /* Synchronize UART_IER access against the console. */ +- spin_lock(&port->lock); ++ uart_port_lock(port); + up->ier = port->serial_in(port, UART_IER); + if (up->ier & (UART_IER_RLSI | UART_IER_RDI)) { + port->ops->stop_rx(port); +@@ -670,7 +670,7 @@ static irqreturn_t omap8250_irq(int irq, void *dev_id) + */ + cancel_delayed_work(&up->overrun_backoff); + } +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + delay = msecs_to_jiffies(up->overrun_backoff_time_ms); + schedule_delayed_work(&up->overrun_backoff, delay); +@@ -717,10 +717,10 @@ static int omap_8250_startup(struct uart_port *port) + } + + /* Synchronize UART_IER access against the console. */ +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + up->ier = UART_IER_RLSI | UART_IER_RDI; + serial_out(up, UART_IER, up->ier); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + + #ifdef CONFIG_PM + up->capabilities |= UART_CAP_RPM; +@@ -733,9 +733,9 @@ static int omap_8250_startup(struct uart_port *port) + serial_out(up, UART_OMAP_WER, priv->wer); + + if (up->dma && !(priv->habit & UART_HAS_EFR2)) { +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + up->dma->rx_dma(up); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + } + + enable_irq(up->port.irq); +@@ -761,10 +761,10 @@ static void omap_8250_shutdown(struct uart_port *port) + serial_out(up, UART_OMAP_EFR2, 0x0); + + /* Synchronize UART_IER access against the console. */ +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + up->ier = 0; + serial_out(up, UART_IER, 0); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + disable_irq_nosync(up->port.irq); + dev_pm_clear_wake_irq(port->dev); + +@@ -789,10 +789,10 @@ static void omap_8250_throttle(struct uart_port *port) + + pm_runtime_get_sync(port->dev); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + port->ops->stop_rx(port); + priv->throttled = true; +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + pm_runtime_mark_last_busy(port->dev); + pm_runtime_put_autosuspend(port->dev); +@@ -807,14 +807,14 @@ static void omap_8250_unthrottle(struct uart_port *port) + pm_runtime_get_sync(port->dev); + + /* Synchronize UART_IER access against the console. */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + priv->throttled = false; + if (up->dma) + up->dma->rx_dma(up); + up->ier |= UART_IER_RLSI | UART_IER_RDI; + port->read_status_mask |= UART_LSR_DR; + serial_out(up, UART_IER, up->ier); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + pm_runtime_mark_last_busy(port->dev); + pm_runtime_put_autosuspend(port->dev); +@@ -958,7 +958,7 @@ static void __dma_rx_complete(void *param) + unsigned long flags; + + /* Synchronize UART_IER access against the console. */ +- spin_lock_irqsave(&p->port.lock, flags); ++ uart_port_lock_irqsave(&p->port, &flags); + + /* + * If the tx status is not DMA_COMPLETE, then this is a delayed +@@ -967,7 +967,7 @@ static void __dma_rx_complete(void *param) + */ + if (dmaengine_tx_status(dma->rxchan, dma->rx_cookie, &state) != + DMA_COMPLETE) { +- spin_unlock_irqrestore(&p->port.lock, flags); ++ uart_port_unlock_irqrestore(&p->port, flags); + return; + } + __dma_rx_do_complete(p); +@@ -978,7 +978,7 @@ static void __dma_rx_complete(void *param) + omap_8250_rx_dma(p); + } + +- spin_unlock_irqrestore(&p->port.lock, flags); ++ uart_port_unlock_irqrestore(&p->port, flags); + } + + static void omap_8250_rx_dma_flush(struct uart_8250_port *p) +@@ -1083,7 +1083,7 @@ static void omap_8250_dma_tx_complete(void *param) + dma_sync_single_for_cpu(dma->txchan->device->dev, dma->tx_addr, + UART_XMIT_SIZE, DMA_TO_DEVICE); + +- spin_lock_irqsave(&p->port.lock, flags); ++ uart_port_lock_irqsave(&p->port, &flags); + + dma->tx_running = 0; + +@@ -1112,7 +1112,7 @@ static void omap_8250_dma_tx_complete(void *param) + serial8250_set_THRI(p); + } + +- spin_unlock_irqrestore(&p->port.lock, flags); ++ uart_port_unlock_irqrestore(&p->port, flags); + } + + static int omap_8250_tx_dma(struct uart_8250_port *p) +@@ -1278,7 +1278,7 @@ static int omap_8250_dma_handle_irq(struct uart_port *port) + return IRQ_HANDLED; + } + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + status = serial_port_in(port, UART_LSR); + +@@ -1758,15 +1758,15 @@ static int omap8250_runtime_resume(struct device *dev) + up = serial8250_get_port(priv->line); + + if (up && omap8250_lost_context(up)) { +- spin_lock_irq(&up->port.lock); ++ uart_port_lock_irq(&up->port); + omap8250_restore_regs(up); +- spin_unlock_irq(&up->port.lock); ++ uart_port_unlock_irq(&up->port); + } + + if (up && up->dma && up->dma->rxchan && !(priv->habit & UART_HAS_EFR2)) { +- spin_lock_irq(&up->port.lock); ++ uart_port_lock_irq(&up->port); + omap_8250_rx_dma(up); +- spin_unlock_irq(&up->port.lock); ++ uart_port_unlock_irq(&up->port); + } + + priv->latency = priv->calc_latency; +diff --git a/drivers/tty/serial/8250/8250_pci1xxxx.c b/drivers/tty/serial/8250/8250_pci1xxxx.c +index a3b25779d..53e238c8c 100644 +--- a/drivers/tty/serial/8250/8250_pci1xxxx.c ++++ b/drivers/tty/serial/8250/8250_pci1xxxx.c +@@ -225,10 +225,10 @@ static bool pci1xxxx_port_suspend(int line) + if (port->suspended == 0 && port->dev) { + wakeup_mask = readb(up->port.membase + UART_WAKE_MASK_REG); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + port->mctrl &= ~TIOCM_OUT2; + port->ops->set_mctrl(port, port->mctrl); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + ret = (wakeup_mask & UART_WAKE_SRCS) != UART_WAKE_SRCS; + } +@@ -251,10 +251,10 @@ static void pci1xxxx_port_resume(int line) + writeb(UART_WAKE_SRCS, port->membase + UART_WAKE_REG); + + if (port->suspended == 0) { +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + port->mctrl |= TIOCM_OUT2; + port->ops->set_mctrl(port, port->mctrl); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + mutex_unlock(&tport->mutex); + } +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c +index a17803da8..2d4e775cd 100644 +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -557,6 +557,11 @@ static int serial8250_em485_init(struct uart_8250_port *p) + if (!p->em485) + return -ENOMEM; + ++#ifndef CONFIG_SERIAL_8250_LEGACY_CONSOLE ++ if (uart_console(&p->port)) ++ dev_warn(p->port.dev, "no atomic printing for rs485 consoles\n"); ++#endif ++ + hrtimer_init(&p->em485->stop_tx_timer, CLOCK_MONOTONIC, + HRTIMER_MODE_REL); + hrtimer_init(&p->em485->start_tx_timer, CLOCK_MONOTONIC, +@@ -689,7 +694,7 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep) + + if (p->capabilities & UART_CAP_SLEEP) { + /* Synchronize UART_IER access against the console. */ +- spin_lock_irq(&p->port.lock); ++ uart_port_lock_irq(&p->port); + if (p->capabilities & UART_CAP_EFR) { + lcr = serial_in(p, UART_LCR); + efr = serial_in(p, UART_EFR); +@@ -703,13 +708,17 @@ static void serial8250_set_sleep(struct uart_8250_port *p, int sleep) + serial_out(p, UART_EFR, efr); + serial_out(p, UART_LCR, lcr); + } +- spin_unlock_irq(&p->port.lock); ++ uart_port_unlock_irq(&p->port); + } + + serial8250_rpm_put(p); + } + +-static void serial8250_clear_IER(struct uart_8250_port *up) ++/* ++ * Only to be used by write_atomic() and the legacy write(), which do not ++ * require port lock. ++ */ ++static void __serial8250_clear_IER(struct uart_8250_port *up) + { + if (up->capabilities & UART_CAP_UUE) + serial_out(up, UART_IER, UART_IER_UUE); +@@ -717,6 +726,14 @@ static void serial8250_clear_IER(struct uart_8250_port *up) + serial_out(up, UART_IER, 0); + } + ++static inline void serial8250_clear_IER(struct uart_8250_port *up) ++{ ++ /* Port locked to synchronize UART_IER access against the console. */ ++ lockdep_assert_held_once(&up->port.lock); ++ ++ __serial8250_clear_IER(up); ++} ++ + #ifdef CONFIG_SERIAL_8250_RSA + /* + * Attempts to turn on the RSA FIFO. Returns zero on failure. +@@ -746,9 +763,9 @@ static void enable_rsa(struct uart_8250_port *up) + { + if (up->port.type == PORT_RSA) { + if (up->port.uartclk != SERIAL_RSA_BAUD_BASE * 16) { +- spin_lock_irq(&up->port.lock); ++ uart_port_lock_irq(&up->port); + __enable_rsa(up); +- spin_unlock_irq(&up->port.lock); ++ uart_port_unlock_irq(&up->port); + } + if (up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16) + serial_out(up, UART_RSA_FRR, 0); +@@ -768,7 +785,7 @@ static void disable_rsa(struct uart_8250_port *up) + + if (up->port.type == PORT_RSA && + up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16) { +- spin_lock_irq(&up->port.lock); ++ uart_port_lock_irq(&up->port); + + mode = serial_in(up, UART_RSA_MSR); + result = !(mode & UART_RSA_MSR_FIFO); +@@ -781,7 +798,7 @@ static void disable_rsa(struct uart_8250_port *up) + + if (result) + up->port.uartclk = SERIAL_RSA_BAUD_BASE_LO * 16; +- spin_unlock_irq(&up->port.lock); ++ uart_port_unlock_irq(&up->port); + } + } + #endif /* CONFIG_SERIAL_8250_RSA */ +@@ -1172,7 +1189,7 @@ static void autoconfig(struct uart_8250_port *up) + * + * Synchronize UART_IER access against the console. + */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + up->capabilities = 0; + up->bugs = 0; +@@ -1211,7 +1228,7 @@ static void autoconfig(struct uart_8250_port *up) + /* + * We failed; there's nothing here + */ +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + DEBUG_AUTOCONF("IER test failed (%02x, %02x) ", + scratch2, scratch3); + goto out; +@@ -1235,7 +1252,7 @@ static void autoconfig(struct uart_8250_port *up) + status1 = serial_in(up, UART_MSR) & UART_MSR_STATUS_BITS; + serial8250_out_MCR(up, save_mcr); + if (status1 != (UART_MSR_DCD | UART_MSR_CTS)) { +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + DEBUG_AUTOCONF("LOOP test failed (%02x) ", + status1); + goto out; +@@ -1304,7 +1321,7 @@ static void autoconfig(struct uart_8250_port *up) + serial8250_clear_IER(up); + + out_unlock: +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* + * Check if the device is a Fintek F81216A +@@ -1341,9 +1358,9 @@ static void autoconfig_irq(struct uart_8250_port *up) + probe_irq_off(probe_irq_on()); + save_mcr = serial8250_in_MCR(up); + /* Synchronize UART_IER access against the console. */ +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + save_ier = serial_in(up, UART_IER); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + serial8250_out_MCR(up, UART_MCR_OUT1 | UART_MCR_OUT2); + + irqs = probe_irq_on(); +@@ -1356,9 +1373,9 @@ static void autoconfig_irq(struct uart_8250_port *up) + UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2); + } + /* Synchronize UART_IER access against the console. */ +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + serial_out(up, UART_IER, UART_IER_ALL_INTR); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + serial_in(up, UART_LSR); + serial_in(up, UART_RX); + serial_in(up, UART_IIR); +@@ -1369,9 +1386,9 @@ static void autoconfig_irq(struct uart_8250_port *up) + + serial8250_out_MCR(up, save_mcr); + /* Synchronize UART_IER access against the console. */ +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + serial_out(up, UART_IER, save_ier); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + + if (port->flags & UPF_FOURPORT) + outb_p(save_ICP, ICP); +@@ -1436,13 +1453,13 @@ static enum hrtimer_restart serial8250_em485_handle_stop_tx(struct hrtimer *t) + unsigned long flags; + + serial8250_rpm_get(p); +- spin_lock_irqsave(&p->port.lock, flags); ++ uart_port_lock_irqsave(&p->port, &flags); + if (em485->active_timer == &em485->stop_tx_timer) { + p->rs485_stop_tx(p); + em485->active_timer = NULL; + em485->tx_stopped = true; + } +- spin_unlock_irqrestore(&p->port.lock, flags); ++ uart_port_unlock_irqrestore(&p->port, flags); + serial8250_rpm_put(p); + + return HRTIMER_NORESTART; +@@ -1624,12 +1641,12 @@ static enum hrtimer_restart serial8250_em485_handle_start_tx(struct hrtimer *t) + struct uart_8250_port *p = em485->port; + unsigned long flags; + +- spin_lock_irqsave(&p->port.lock, flags); ++ uart_port_lock_irqsave(&p->port, &flags); + if (em485->active_timer == &em485->start_tx_timer) { + __start_tx(&p->port); + em485->active_timer = NULL; + } +- spin_unlock_irqrestore(&p->port.lock, flags); ++ uart_port_unlock_irqrestore(&p->port, flags); + + return HRTIMER_NORESTART; + } +@@ -1912,7 +1929,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) + if (iir & UART_IIR_NO_INT) + return 0; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + status = serial_lsr_in(up); + +@@ -1982,9 +1999,9 @@ static int serial8250_tx_threshold_handle_irq(struct uart_port *port) + if ((iir & UART_IIR_ID) == UART_IIR_THRI) { + struct uart_8250_port *up = up_to_u8250p(port); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + serial8250_tx_chars(up); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + iir = serial_port_in(port, UART_IIR); +@@ -1999,10 +2016,10 @@ static unsigned int serial8250_tx_empty(struct uart_port *port) + + serial8250_rpm_get(up); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (!serial8250_tx_dma_running(up) && uart_lsr_tx_empty(serial_lsr_in(up))) + result = TIOCSER_TEMT; +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + serial8250_rpm_put(up); + +@@ -2064,13 +2081,13 @@ static void serial8250_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + + serial8250_rpm_get(up); +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (break_state == -1) + up->lcr |= UART_LCR_SBC; + else + up->lcr &= ~UART_LCR_SBC; + serial_port_out(port, UART_LCR, up->lcr); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + serial8250_rpm_put(up); + } + +@@ -2205,7 +2222,7 @@ int serial8250_do_startup(struct uart_port *port) + * + * Synchronize UART_IER access against the console. + */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + up->acr = 0; + serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B); + serial_port_out(port, UART_EFR, UART_EFR_ECB); +@@ -2215,7 +2232,7 @@ int serial8250_do_startup(struct uart_port *port) + serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B); + serial_port_out(port, UART_EFR, UART_EFR_ECB); + serial_port_out(port, UART_LCR, 0); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + if (port->type == PORT_DA830) { +@@ -2224,10 +2241,10 @@ int serial8250_do_startup(struct uart_port *port) + * + * Synchronize UART_IER access against the console. + */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + serial_port_out(port, UART_IER, 0); + serial_port_out(port, UART_DA830_PWREMU_MGMT, 0); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + mdelay(10); + + /* Enable Tx, Rx and free run mode */ +@@ -2341,7 +2358,7 @@ int serial8250_do_startup(struct uart_port *port) + * + * Synchronize UART_IER access against the console. + */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + wait_for_xmitr(up, UART_LSR_THRE); + serial_port_out_sync(port, UART_IER, UART_IER_THRI); +@@ -2353,7 +2370,7 @@ int serial8250_do_startup(struct uart_port *port) + iir = serial_port_in(port, UART_IIR); + serial_port_out(port, UART_IER, 0); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (port->irqflags & IRQF_SHARED) + enable_irq(port->irq); +@@ -2376,7 +2393,7 @@ int serial8250_do_startup(struct uart_port *port) + */ + serial_port_out(port, UART_LCR, UART_LCR_WLEN8); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (up->port.flags & UPF_FOURPORT) { + if (!up->port.irq) + up->port.mctrl |= TIOCM_OUT1; +@@ -2422,7 +2439,7 @@ int serial8250_do_startup(struct uart_port *port) + } + + dont_test_tx_en: +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* + * Clear the interrupt registers again for luck, and clear the +@@ -2493,17 +2510,17 @@ void serial8250_do_shutdown(struct uart_port *port) + * + * Synchronize UART_IER access against the console. + */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + up->ier = 0; + serial_port_out(port, UART_IER, 0); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + synchronize_irq(port->irq); + + if (up->dma) + serial8250_release_dma(up); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (port->flags & UPF_FOURPORT) { + /* reset interrupts on the AST Fourport board */ + inb((port->iobase & 0xfe0) | 0x1f); +@@ -2512,7 +2529,7 @@ void serial8250_do_shutdown(struct uart_port *port) + port->mctrl &= ~TIOCM_OUT2; + + serial8250_set_mctrl(port, port->mctrl); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* + * Disable break condition and FIFOs +@@ -2748,14 +2765,14 @@ void serial8250_update_uartclk(struct uart_port *port, unsigned int uartclk) + quot = serial8250_get_divisor(port, baud, &frac); + + serial8250_rpm_get(up); +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + uart_update_timeout(port, termios->c_cflag, baud); + + serial8250_set_divisor(port, baud, quot, frac); + serial_port_out(port, UART_LCR, up->lcr); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + serial8250_rpm_put(up); + + out_unlock: +@@ -2792,7 +2809,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, + * Synchronize UART_IER access against the console. + */ + serial8250_rpm_get(up); +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + up->lcr = cval; /* Save computed LCR */ + +@@ -2895,7 +2912,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, + serial_port_out(port, UART_FCR, up->fcr); /* set fcr */ + } + serial8250_set_mctrl(port, port->mctrl); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + serial8250_rpm_put(up); + + /* Don't rewrite B0 */ +@@ -2918,15 +2935,15 @@ void serial8250_do_set_ldisc(struct uart_port *port, struct ktermios *termios) + { + if (termios->c_line == N_PPS) { + port->flags |= UPF_HARDPPS_CD; +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + serial8250_enable_ms(port); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + } else { + port->flags &= ~UPF_HARDPPS_CD; + if (!UART_ENABLE_MS(port, termios->c_cflag)) { +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + serial8250_disable_ms(port); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + } + } + } +@@ -3322,6 +3339,11 @@ static void serial8250_console_putchar(struct uart_port *port, unsigned char ch) + + wait_for_xmitr(up, UART_LSR_THRE); + serial_port_out(port, UART_TX, ch); ++ ++ if (ch == '\n') ++ up->console_newline_needed = false; ++ else ++ up->console_newline_needed = true; + } + + /* +@@ -3350,6 +3372,7 @@ static void serial8250_console_restore(struct uart_8250_port *up) + serial8250_out_MCR(up, up->mcr | UART_MCR_DTR | UART_MCR_RTS); + } + ++#ifdef CONFIG_SERIAL_8250_LEGACY_CONSOLE + /* + * Print a string to the serial port using the device FIFO + * +@@ -3400,15 +3423,15 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, + touch_nmi_watchdog(); + + if (oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* + * First save the IER then disable the interrupts + */ + ier = serial_port_in(port, UART_IER); +- serial8250_clear_IER(up); ++ __serial8250_clear_IER(up); + + /* check scratch reg to see if port powered off during system sleep */ + if (up->canary && (up->canary != serial_port_in(port, UART_SCR))) { +@@ -3472,8 +3495,137 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, + serial8250_modem_status(up); + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } ++#else ++bool serial8250_console_write_thread(struct uart_8250_port *up, ++ struct nbcon_write_context *wctxt) ++{ ++ struct uart_8250_em485 *em485 = up->em485; ++ struct uart_port *port = &up->port; ++ bool done = false; ++ unsigned int ier; ++ ++ touch_nmi_watchdog(); ++ ++ if (!nbcon_enter_unsafe(wctxt)) ++ return false; ++ ++ /* First save IER then disable the interrupts. */ ++ ier = serial_port_in(port, UART_IER); ++ serial8250_clear_IER(up); ++ ++ /* Check scratch reg if port powered off during system sleep. */ ++ if (up->canary && (up->canary != serial_port_in(port, UART_SCR))) { ++ serial8250_console_restore(up); ++ up->canary = 0; ++ } ++ ++ if (em485) { ++ if (em485->tx_stopped) ++ up->rs485_start_tx(up); ++ mdelay(port->rs485.delay_rts_before_send); ++ } ++ ++ if (nbcon_exit_unsafe(wctxt)) { ++ int len = READ_ONCE(wctxt->len); ++ int i; ++ ++ /* ++ * Write out the message. Toggle unsafe for each byte in order ++ * to give another (higher priority) context the opportunity ++ * for a friendly takeover. If such a takeover occurs, this ++ * context must reacquire ownership in order to perform final ++ * actions (such as re-enabling the interrupts). ++ * ++ * IMPORTANT: wctxt->outbuf and wctxt->len are no longer valid ++ * after a reacquire so writing the message must be ++ * aborted. ++ */ ++ for (i = 0; i < len; i++) { ++ if (!nbcon_enter_unsafe(wctxt)) { ++ nbcon_reacquire(wctxt); ++ break; ++ } ++ ++ uart_console_write(port, wctxt->outbuf + i, 1, serial8250_console_putchar); ++ ++ if (!nbcon_exit_unsafe(wctxt)) { ++ nbcon_reacquire(wctxt); ++ break; ++ } ++ } ++ done = (i == len); ++ } else { ++ nbcon_reacquire(wctxt); ++ } ++ ++ while (!nbcon_enter_unsafe(wctxt)) ++ nbcon_reacquire(wctxt); ++ ++ /* Finally, wait for transmitter to become empty and restore IER. */ ++ wait_for_xmitr(up, UART_LSR_BOTH_EMPTY); ++ if (em485) { ++ mdelay(port->rs485.delay_rts_after_send); ++ if (em485->tx_stopped) ++ up->rs485_stop_tx(up); ++ } ++ serial_port_out(port, UART_IER, ier); ++ ++ /* ++ * The receive handling will happen properly because the receive ready ++ * bit will still be set; it is not cleared on read. However, modem ++ * control will not, we must call it if we have saved something in the ++ * saved flags while processing with interrupts off. ++ */ ++ if (up->msr_saved_flags) ++ serial8250_modem_status(up); ++ ++ /* Success if no handover/takeover and message fully printed. */ ++ return (nbcon_exit_unsafe(wctxt) && done); ++} ++ ++bool serial8250_console_write_atomic(struct uart_8250_port *up, ++ struct nbcon_write_context *wctxt) ++{ ++ struct uart_port *port = &up->port; ++ unsigned int ier; ++ ++ /* Atomic console not supported for rs485 mode. */ ++ if (up->em485) ++ return false; ++ ++ touch_nmi_watchdog(); ++ ++ if (!nbcon_enter_unsafe(wctxt)) ++ return false; ++ ++ /* ++ * First save IER then disable the interrupts. The special variant to ++ * clear IER is used because atomic printing may occur without holding ++ * the port lock. ++ */ ++ ier = serial_port_in(port, UART_IER); ++ __serial8250_clear_IER(up); ++ ++ /* Check scratch reg if port powered off during system sleep. */ ++ if (up->canary && (up->canary != serial_port_in(port, UART_SCR))) { ++ serial8250_console_restore(up); ++ up->canary = 0; ++ } ++ ++ if (up->console_newline_needed) ++ uart_console_write(port, "\n", 1, serial8250_console_putchar); ++ uart_console_write(port, wctxt->outbuf, wctxt->len, serial8250_console_putchar); ++ ++ /* Finally, wait for transmitter to become empty and restore IER. */ ++ wait_for_xmitr(up, UART_LSR_BOTH_EMPTY); ++ serial_port_out(port, UART_IER, ier); ++ ++ /* Success if no handover/takeover. */ ++ return nbcon_exit_unsafe(wctxt); ++} ++#endif /* CONFIG_SERIAL_8250_LEGACY_CONSOLE */ + + static unsigned int probe_baud(struct uart_port *port) + { +@@ -3492,6 +3644,7 @@ static unsigned int probe_baud(struct uart_port *port) + + int serial8250_console_setup(struct uart_port *port, char *options, bool probe) + { ++ struct uart_8250_port *up = up_to_u8250p(port); + int baud = 9600; + int bits = 8; + int parity = 'n'; +@@ -3501,6 +3654,8 @@ int serial8250_console_setup(struct uart_port *port, char *options, bool probe) + if (!port->iobase && !port->membase) + return -ENODEV; + ++ up->console_newline_needed = false; ++ + if (options) + uart_parse_options(options, &baud, &parity, &bits, &flow); + else if (probe) +diff --git a/drivers/tty/serial/altera_jtaguart.c b/drivers/tty/serial/altera_jtaguart.c +index 5fab4c978..7090b251d 100644 +--- a/drivers/tty/serial/altera_jtaguart.c ++++ b/drivers/tty/serial/altera_jtaguart.c +@@ -147,14 +147,14 @@ static irqreturn_t altera_jtaguart_interrupt(int irq, void *data) + isr = (readl(port->membase + ALTERA_JTAGUART_CONTROL_REG) >> + ALTERA_JTAGUART_CONTROL_RI_OFF) & port->read_status_mask; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + if (isr & ALTERA_JTAGUART_CONTROL_RE_MSK) + altera_jtaguart_rx_chars(port); + if (isr & ALTERA_JTAGUART_CONTROL_WE_MSK) + altera_jtaguart_tx_chars(port); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_RETVAL(isr); + } +@@ -180,14 +180,14 @@ static int altera_jtaguart_startup(struct uart_port *port) + return ret; + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Enable RX interrupts now */ + port->read_status_mask = ALTERA_JTAGUART_CONTROL_RE_MSK; + writel(port->read_status_mask, + port->membase + ALTERA_JTAGUART_CONTROL_REG); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return 0; + } +@@ -196,14 +196,14 @@ static void altera_jtaguart_shutdown(struct uart_port *port) + { + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Disable all interrupts now */ + port->read_status_mask = 0; + writel(port->read_status_mask, + port->membase + ALTERA_JTAGUART_CONTROL_REG); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + free_irq(port->irq, port); + } +@@ -264,33 +264,33 @@ static void altera_jtaguart_console_putc(struct uart_port *port, unsigned char c + unsigned long flags; + u32 status; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + while (!altera_jtaguart_tx_space(port, &status)) { +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if ((status & ALTERA_JTAGUART_CONTROL_AC_MSK) == 0) { + return; /* no connection activity */ + } + + cpu_relax(); +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + } + writel(c, port->membase + ALTERA_JTAGUART_DATA_REG); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + #else + static void altera_jtaguart_console_putc(struct uart_port *port, unsigned char c) + { + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + while (!altera_jtaguart_tx_space(port, NULL)) { +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + cpu_relax(); +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + } + writel(c, port->membase + ALTERA_JTAGUART_DATA_REG); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + #endif + +diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c +index a9c419421..77835ac68 100644 +--- a/drivers/tty/serial/altera_uart.c ++++ b/drivers/tty/serial/altera_uart.c +@@ -164,13 +164,13 @@ static void altera_uart_break_ctl(struct uart_port *port, int break_state) + struct altera_uart *pp = container_of(port, struct altera_uart, port); + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (break_state == -1) + pp->imr |= ALTERA_UART_CONTROL_TRBK_MSK; + else + pp->imr &= ~ALTERA_UART_CONTROL_TRBK_MSK; + altera_uart_update_ctrl_reg(pp); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void altera_uart_set_termios(struct uart_port *port, +@@ -187,10 +187,10 @@ static void altera_uart_set_termios(struct uart_port *port, + tty_termios_copy_hw(termios, old); + tty_termios_encode_baud_rate(termios, baud, baud); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + uart_update_timeout(port, termios->c_cflag, baud); + altera_uart_writel(port, baudclk, ALTERA_UART_DIVISOR_REG); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* + * FIXME: port->read_status_mask and port->ignore_status_mask +@@ -264,12 +264,12 @@ static irqreturn_t altera_uart_interrupt(int irq, void *data) + + isr = altera_uart_readl(port, ALTERA_UART_STATUS_REG) & pp->imr; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (isr & ALTERA_UART_STATUS_RRDY_MSK) + altera_uart_rx_chars(port); + if (isr & ALTERA_UART_STATUS_TRDY_MSK) + altera_uart_tx_chars(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return IRQ_RETVAL(isr); + } +@@ -313,13 +313,13 @@ static int altera_uart_startup(struct uart_port *port) + } + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Enable RX interrupts now */ + pp->imr = ALTERA_UART_CONTROL_RRDY_MSK; + altera_uart_update_ctrl_reg(pp); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return 0; + } +@@ -329,13 +329,13 @@ static void altera_uart_shutdown(struct uart_port *port) + struct altera_uart *pp = container_of(port, struct altera_uart, port); + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Disable all interrupts now */ + pp->imr = 0; + altera_uart_update_ctrl_reg(pp); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (port->irq) + free_irq(port->irq, port); +diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c +index b5a7404cb..eabbf8afc 100644 +--- a/drivers/tty/serial/amba-pl010.c ++++ b/drivers/tty/serial/amba-pl010.c +@@ -207,7 +207,7 @@ static irqreturn_t pl010_int(int irq, void *dev_id) + unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT; + int handled = 0; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + status = readb(port->membase + UART010_IIR); + if (status) { +@@ -228,7 +228,7 @@ static irqreturn_t pl010_int(int irq, void *dev_id) + handled = 1; + } + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_RETVAL(handled); + } +@@ -270,14 +270,14 @@ static void pl010_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + unsigned int lcr_h; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + lcr_h = readb(port->membase + UART010_LCRH); + if (break_state == -1) + lcr_h |= UART01x_LCRH_BRK; + else + lcr_h &= ~UART01x_LCRH_BRK; + writel(lcr_h, port->membase + UART010_LCRH); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int pl010_startup(struct uart_port *port) +@@ -385,7 +385,7 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios, + if (port->fifosize > 1) + lcr_h |= UART01x_LCRH_FEN; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* + * Update the per-port timeout. +@@ -438,22 +438,22 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios, + writel(lcr_h, port->membase + UART010_LCRH); + writel(old_cr, port->membase + UART010_CR); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void pl010_set_ldisc(struct uart_port *port, struct ktermios *termios) + { + if (termios->c_line == N_PPS) { + port->flags |= UPF_HARDPPS_CD; +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + pl010_enable_ms(port); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + } else { + port->flags &= ~UPF_HARDPPS_CD; + if (!UART_ENABLE_MS(port, termios->c_cflag)) { +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + pl010_disable_ms(port); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + } + } + } +diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c +index 362bbcdec..9cd660edb 100644 +--- a/drivers/tty/serial/amba-pl011.c ++++ b/drivers/tty/serial/amba-pl011.c +@@ -347,9 +347,9 @@ static int pl011_fifo_to_tty(struct uart_amba_port *uap) + flag = TTY_FRAME; + } + +- spin_unlock(&uap->port.lock); ++ uart_port_unlock(&uap->port); + sysrq = uart_handle_sysrq_char(&uap->port, ch & 255); +- spin_lock(&uap->port.lock); ++ uart_port_lock(&uap->port); + + if (!sysrq) + uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag); +@@ -544,7 +544,7 @@ static void pl011_dma_tx_callback(void *data) + unsigned long flags; + u16 dmacr; + +- spin_lock_irqsave(&uap->port.lock, flags); ++ uart_port_lock_irqsave(&uap->port, &flags); + if (uap->dmatx.queued) + dma_unmap_single(dmatx->chan->device->dev, dmatx->dma, + dmatx->len, DMA_TO_DEVICE); +@@ -565,7 +565,7 @@ static void pl011_dma_tx_callback(void *data) + if (!(dmacr & UART011_TXDMAE) || uart_tx_stopped(&uap->port) || + uart_circ_empty(&uap->port.state->xmit)) { + uap->dmatx.queued = false; +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + return; + } + +@@ -576,7 +576,7 @@ static void pl011_dma_tx_callback(void *data) + */ + pl011_start_tx_pio(uap); + +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + } + + /* +@@ -1004,7 +1004,7 @@ static void pl011_dma_rx_callback(void *data) + * routine to flush out the secondary DMA buffer while + * we immediately trigger the next DMA job. + */ +- spin_lock_irq(&uap->port.lock); ++ uart_port_lock_irq(&uap->port); + /* + * Rx data can be taken by the UART interrupts during + * the DMA irq handler. So we check the residue here. +@@ -1020,7 +1020,7 @@ static void pl011_dma_rx_callback(void *data) + ret = pl011_dma_rx_trigger_dma(uap); + + pl011_dma_rx_chars(uap, pending, lastbuf, false); +- spin_unlock_irq(&uap->port.lock); ++ uart_port_unlock_irq(&uap->port); + /* + * Do this check after we picked the DMA chars so we don't + * get some IRQ immediately from RX. +@@ -1086,11 +1086,11 @@ static void pl011_dma_rx_poll(struct timer_list *t) + if (jiffies_to_msecs(jiffies - dmarx->last_jiffies) + > uap->dmarx.poll_timeout) { + +- spin_lock_irqsave(&uap->port.lock, flags); ++ uart_port_lock_irqsave(&uap->port, &flags); + pl011_dma_rx_stop(uap); + uap->im |= UART011_RXIM; + pl011_write(uap->im, uap, REG_IMSC); +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + + uap->dmarx.running = false; + dmaengine_terminate_all(rxchan); +@@ -1186,10 +1186,10 @@ static void pl011_dma_shutdown(struct uart_amba_port *uap) + while (pl011_read(uap, REG_FR) & uap->vendor->fr_busy) + cpu_relax(); + +- spin_lock_irq(&uap->port.lock); ++ uart_port_lock_irq(&uap->port); + uap->dmacr &= ~(UART011_DMAONERR | UART011_RXDMAE | UART011_TXDMAE); + pl011_write(uap->dmacr, uap, REG_DMACR); +- spin_unlock_irq(&uap->port.lock); ++ uart_port_unlock_irq(&uap->port); + + if (uap->using_tx_dma) { + /* In theory, this should already be done by pl011_dma_flush_buffer */ +@@ -1400,9 +1400,9 @@ static void pl011_throttle_rx(struct uart_port *port) + { + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + pl011_stop_rx(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void pl011_enable_ms(struct uart_port *port) +@@ -1420,7 +1420,7 @@ __acquires(&uap->port.lock) + { + pl011_fifo_to_tty(uap); + +- spin_unlock(&uap->port.lock); ++ uart_port_unlock(&uap->port); + tty_flip_buffer_push(&uap->port.state->port); + /* + * If we were temporarily out of DMA mode for a while, +@@ -1445,7 +1445,7 @@ __acquires(&uap->port.lock) + #endif + } + } +- spin_lock(&uap->port.lock); ++ uart_port_lock(&uap->port); + } + + static bool pl011_tx_char(struct uart_amba_port *uap, unsigned char c, +@@ -1551,7 +1551,7 @@ static irqreturn_t pl011_int(int irq, void *dev_id) + unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT; + int handled = 0; + +- spin_lock_irqsave(&uap->port.lock, flags); ++ uart_port_lock_irqsave(&uap->port, &flags); + status = pl011_read(uap, REG_RIS) & uap->im; + if (status) { + do { +@@ -1581,7 +1581,7 @@ static irqreturn_t pl011_int(int irq, void *dev_id) + handled = 1; + } + +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + + return IRQ_RETVAL(handled); + } +@@ -1653,14 +1653,14 @@ static void pl011_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + unsigned int lcr_h; + +- spin_lock_irqsave(&uap->port.lock, flags); ++ uart_port_lock_irqsave(&uap->port, &flags); + lcr_h = pl011_read(uap, REG_LCRH_TX); + if (break_state == -1) + lcr_h |= UART01x_LCRH_BRK; + else + lcr_h &= ~UART01x_LCRH_BRK; + pl011_write(lcr_h, uap, REG_LCRH_TX); +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + } + + #ifdef CONFIG_CONSOLE_POLL +@@ -1799,7 +1799,7 @@ static void pl011_enable_interrupts(struct uart_amba_port *uap) + unsigned long flags; + unsigned int i; + +- spin_lock_irqsave(&uap->port.lock, flags); ++ uart_port_lock_irqsave(&uap->port, &flags); + + /* Clear out any spuriously appearing RX interrupts */ + pl011_write(UART011_RTIS | UART011_RXIS, uap, REG_ICR); +@@ -1821,7 +1821,7 @@ static void pl011_enable_interrupts(struct uart_amba_port *uap) + if (!pl011_dma_rx_running(uap)) + uap->im |= UART011_RXIM; + pl011_write(uap->im, uap, REG_IMSC); +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + } + + static void pl011_unthrottle_rx(struct uart_port *port) +@@ -1829,7 +1829,7 @@ static void pl011_unthrottle_rx(struct uart_port *port) + struct uart_amba_port *uap = container_of(port, struct uart_amba_port, port); + unsigned long flags; + +- spin_lock_irqsave(&uap->port.lock, flags); ++ uart_port_lock_irqsave(&uap->port, &flags); + + uap->im = UART011_RTIM; + if (!pl011_dma_rx_running(uap)) +@@ -1837,7 +1837,7 @@ static void pl011_unthrottle_rx(struct uart_port *port) + + pl011_write(uap->im, uap, REG_IMSC); + +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + } + + static int pl011_startup(struct uart_port *port) +@@ -1857,7 +1857,7 @@ static int pl011_startup(struct uart_port *port) + + pl011_write(uap->vendor->ifls, uap, REG_IFLS); + +- spin_lock_irq(&uap->port.lock); ++ uart_port_lock_irq(&uap->port); + + cr = pl011_read(uap, REG_CR); + cr &= UART011_CR_RTS | UART011_CR_DTR; +@@ -1868,7 +1868,7 @@ static int pl011_startup(struct uart_port *port) + + pl011_write(cr, uap, REG_CR); + +- spin_unlock_irq(&uap->port.lock); ++ uart_port_unlock_irq(&uap->port); + + /* + * initialise the old status of the modem signals +@@ -1929,12 +1929,12 @@ static void pl011_disable_uart(struct uart_amba_port *uap) + unsigned int cr; + + uap->port.status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS); +- spin_lock_irq(&uap->port.lock); ++ uart_port_lock_irq(&uap->port); + cr = pl011_read(uap, REG_CR); + cr &= UART011_CR_RTS | UART011_CR_DTR; + cr |= UART01x_CR_UARTEN | UART011_CR_TXE; + pl011_write(cr, uap, REG_CR); +- spin_unlock_irq(&uap->port.lock); ++ uart_port_unlock_irq(&uap->port); + + /* + * disable break condition and fifos +@@ -1946,14 +1946,14 @@ static void pl011_disable_uart(struct uart_amba_port *uap) + + static void pl011_disable_interrupts(struct uart_amba_port *uap) + { +- spin_lock_irq(&uap->port.lock); ++ uart_port_lock_irq(&uap->port); + + /* mask all interrupts and clear all pending ones */ + uap->im = 0; + pl011_write(uap->im, uap, REG_IMSC); + pl011_write(0xffff, uap, REG_ICR); + +- spin_unlock_irq(&uap->port.lock); ++ uart_port_unlock_irq(&uap->port); + } + + static void pl011_shutdown(struct uart_port *port) +@@ -2098,7 +2098,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, + + bits = tty_get_frame_size(termios->c_cflag); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* + * Update the per-port timeout. +@@ -2172,7 +2172,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, + old_cr |= UART011_CR_RXE; + pl011_write(old_cr, uap, REG_CR); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void +@@ -2190,10 +2190,10 @@ sbsa_uart_set_termios(struct uart_port *port, struct ktermios *termios, + termios->c_cflag &= ~(CMSPAR | CRTSCTS); + termios->c_cflag |= CS8 | CLOCAL; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + uart_update_timeout(port, CS8, uap->fixed_baud); + pl011_setup_status_masks(port, termios); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *pl011_type(struct uart_port *port) +@@ -2328,13 +2328,10 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) + + clk_enable(uap->clk); + +- local_irq_save(flags); +- if (uap->port.sysrq) +- locked = 0; +- else if (oops_in_progress) +- locked = spin_trylock(&uap->port.lock); ++ if (uap->port.sysrq || oops_in_progress) ++ locked = uart_port_trylock_irqsave(&uap->port, &flags); + else +- spin_lock(&uap->port.lock); ++ uart_port_lock_irqsave(&uap->port, &flags); + + /* + * First save the CR then disable the interrupts +@@ -2360,8 +2357,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) + pl011_write(old_cr, uap, REG_CR); + + if (locked) +- spin_unlock(&uap->port.lock); +- local_irq_restore(flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + + clk_disable(uap->clk); + } +diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c +index d3cb341f2..364599f25 100644 +--- a/drivers/tty/serial/apbuart.c ++++ b/drivers/tty/serial/apbuart.c +@@ -133,7 +133,7 @@ static irqreturn_t apbuart_int(int irq, void *dev_id) + struct uart_port *port = dev_id; + unsigned int status; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + status = UART_GET_STATUS(port); + if (status & UART_STATUS_DR) +@@ -141,7 +141,7 @@ static irqreturn_t apbuart_int(int irq, void *dev_id) + if (status & UART_STATUS_THE) + apbuart_tx_chars(port); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -228,7 +228,7 @@ static void apbuart_set_termios(struct uart_port *port, + if (termios->c_cflag & CRTSCTS) + cr |= UART_CTRL_FL; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Update the per-port timeout. */ + uart_update_timeout(port, termios->c_cflag, baud); +@@ -251,7 +251,7 @@ static void apbuart_set_termios(struct uart_port *port, + UART_PUT_SCAL(port, quot); + UART_PUT_CTRL(port, cr); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *apbuart_type(struct uart_port *port) +diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c +index 924c1a893..ffd234673 100644 +--- a/drivers/tty/serial/ar933x_uart.c ++++ b/drivers/tty/serial/ar933x_uart.c +@@ -133,9 +133,9 @@ static unsigned int ar933x_uart_tx_empty(struct uart_port *port) + unsigned long flags; + unsigned int rdata; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + rdata = ar933x_uart_read(up, AR933X_UART_DATA_REG); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + return (rdata & AR933X_UART_DATA_TX_CSR) ? 0 : TIOCSER_TEMT; + } +@@ -220,14 +220,14 @@ static void ar933x_uart_break_ctl(struct uart_port *port, int break_state) + container_of(port, struct ar933x_uart_port, port); + unsigned long flags; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + if (break_state == -1) + ar933x_uart_rmw_set(up, AR933X_UART_CS_REG, + AR933X_UART_CS_TX_BREAK); + else + ar933x_uart_rmw_clear(up, AR933X_UART_CS_REG, + AR933X_UART_CS_TX_BREAK); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + /* +@@ -318,7 +318,7 @@ static void ar933x_uart_set_termios(struct uart_port *port, + * Ok, we're now changing the port state. Do it with + * interrupts disabled. + */ +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* disable the UART */ + ar933x_uart_rmw_clear(up, AR933X_UART_CS_REG, +@@ -352,7 +352,7 @@ static void ar933x_uart_set_termios(struct uart_port *port, + AR933X_UART_CS_IF_MODE_M << AR933X_UART_CS_IF_MODE_S, + AR933X_UART_CS_IF_MODE_DCE << AR933X_UART_CS_IF_MODE_S); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + if (tty_termios_baud_rate(new)) + tty_termios_encode_baud_rate(new, baud, baud); +@@ -450,7 +450,7 @@ static irqreturn_t ar933x_uart_interrupt(int irq, void *dev_id) + if ((status & AR933X_UART_CS_HOST_INT) == 0) + return IRQ_NONE; + +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + + status = ar933x_uart_read(up, AR933X_UART_INT_REG); + status &= ar933x_uart_read(up, AR933X_UART_INT_EN_REG); +@@ -468,7 +468,7 @@ static irqreturn_t ar933x_uart_interrupt(int irq, void *dev_id) + ar933x_uart_tx_chars(up); + } + +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + + return IRQ_HANDLED; + } +@@ -485,7 +485,7 @@ static int ar933x_uart_startup(struct uart_port *port) + if (ret) + return ret; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* Enable HOST interrupts */ + ar933x_uart_rmw_set(up, AR933X_UART_CS_REG, +@@ -498,7 +498,7 @@ static int ar933x_uart_startup(struct uart_port *port) + /* Enable RX interrupts */ + ar933x_uart_start_rx_interrupt(up); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + return 0; + } +@@ -632,9 +632,9 @@ static void ar933x_uart_console_write(struct console *co, const char *s, + if (up->port.sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock(&up->port.lock); ++ locked = uart_port_trylock(&up->port); + else +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + + /* + * First save the IER then disable the interrupts +@@ -654,7 +654,7 @@ static void ar933x_uart_console_write(struct console *co, const char *s, + ar933x_uart_write(up, AR933X_UART_INT_REG, AR933X_UART_INT_ALLINTS); + + if (locked) +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + + local_irq_restore(flags); + } +diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c +index ad4ae19b6..1aa5b2b49 100644 +--- a/drivers/tty/serial/arc_uart.c ++++ b/drivers/tty/serial/arc_uart.c +@@ -279,9 +279,9 @@ static irqreturn_t arc_serial_isr(int irq, void *dev_id) + if (status & RXIENB) { + + /* already in ISR, no need of xx_irqsave */ +- spin_lock(&port->lock); ++ uart_port_lock(port); + arc_serial_rx_chars(port, status); +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + } + + if ((status & TXIENB) && (status & TXEMPTY)) { +@@ -291,12 +291,12 @@ static irqreturn_t arc_serial_isr(int irq, void *dev_id) + */ + UART_TX_IRQ_DISABLE(port); + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + if (!uart_tx_stopped(port)) + arc_serial_tx_chars(port); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + } + + return IRQ_HANDLED; +@@ -366,7 +366,7 @@ arc_serial_set_termios(struct uart_port *port, struct ktermios *new, + uartl = hw_val & 0xFF; + uarth = (hw_val >> 8) & 0xFF; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + UART_ALL_IRQ_DISABLE(port); + +@@ -391,7 +391,7 @@ arc_serial_set_termios(struct uart_port *port, struct ktermios *new, + + uart_update_timeout(port, new->c_cflag, baud); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *arc_serial_type(struct uart_port *port) +@@ -521,9 +521,9 @@ static void arc_serial_console_write(struct console *co, const char *s, + struct uart_port *port = &arc_uart_ports[co->index].port; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + uart_console_write(port, s, count, arc_serial_console_putchar); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static struct console arc_console = { +diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c +index 88cdafa5a..1946fafc3 100644 +--- a/drivers/tty/serial/atmel_serial.c ++++ b/drivers/tty/serial/atmel_serial.c +@@ -861,7 +861,7 @@ static void atmel_complete_tx_dma(void *arg) + struct dma_chan *chan = atmel_port->chan_tx; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + if (chan) + dmaengine_terminate_all(chan); +@@ -893,7 +893,7 @@ static void atmel_complete_tx_dma(void *arg) + atmel_port->tx_done_mask); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void atmel_release_tx_dma(struct uart_port *port) +@@ -1711,9 +1711,9 @@ static void atmel_tasklet_rx_func(struct tasklet_struct *t) + struct uart_port *port = &atmel_port->uart; + + /* The interrupt handler does not take the lock */ +- spin_lock(&port->lock); ++ uart_port_lock(port); + atmel_port->schedule_rx(port); +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + } + + static void atmel_tasklet_tx_func(struct tasklet_struct *t) +@@ -1723,9 +1723,9 @@ static void atmel_tasklet_tx_func(struct tasklet_struct *t) + struct uart_port *port = &atmel_port->uart; + + /* The interrupt handler does not take the lock */ +- spin_lock(&port->lock); ++ uart_port_lock(port); + atmel_port->schedule_tx(port); +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + } + + static void atmel_init_property(struct atmel_uart_port *atmel_port, +@@ -2175,7 +2175,7 @@ static void atmel_set_termios(struct uart_port *port, + } else + mode |= ATMEL_US_PAR_NONE; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + port->read_status_mask = ATMEL_US_OVRE; + if (termios->c_iflag & INPCK) +@@ -2377,22 +2377,22 @@ static void atmel_set_termios(struct uart_port *port, + else + atmel_disable_ms(port); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void atmel_set_ldisc(struct uart_port *port, struct ktermios *termios) + { + if (termios->c_line == N_PPS) { + port->flags |= UPF_HARDPPS_CD; +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + atmel_enable_ms(port); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + } else { + port->flags &= ~UPF_HARDPPS_CD; + if (!UART_ENABLE_MS(port, termios->c_cflag)) { +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + atmel_disable_ms(port); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + } + } + } +diff --git a/drivers/tty/serial/bcm63xx_uart.c b/drivers/tty/serial/bcm63xx_uart.c +index 0dd8cceb8..4a08fd5ee 100644 +--- a/drivers/tty/serial/bcm63xx_uart.c ++++ b/drivers/tty/serial/bcm63xx_uart.c +@@ -201,7 +201,7 @@ static void bcm_uart_break_ctl(struct uart_port *port, int ctl) + unsigned long flags; + unsigned int val; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + val = bcm_uart_readl(port, UART_CTL_REG); + if (ctl) +@@ -210,7 +210,7 @@ static void bcm_uart_break_ctl(struct uart_port *port, int ctl) + val &= ~UART_CTL_XMITBRK_MASK; + bcm_uart_writel(port, val, UART_CTL_REG); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* +@@ -332,7 +332,7 @@ static irqreturn_t bcm_uart_interrupt(int irq, void *dev_id) + unsigned int irqstat; + + port = dev_id; +- spin_lock(&port->lock); ++ uart_port_lock(port); + + irqstat = bcm_uart_readl(port, UART_IR_REG); + if (irqstat & UART_RX_INT_STAT) +@@ -353,7 +353,7 @@ static irqreturn_t bcm_uart_interrupt(int irq, void *dev_id) + estat & UART_EXTINP_DCD_MASK); + } + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + return IRQ_HANDLED; + } + +@@ -451,9 +451,9 @@ static void bcm_uart_shutdown(struct uart_port *port) + { + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + bcm_uart_writel(port, 0, UART_IR_REG); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + bcm_uart_disable(port); + bcm_uart_flush(port); +@@ -470,7 +470,7 @@ static void bcm_uart_set_termios(struct uart_port *port, struct ktermios *new, + unsigned long flags; + int tries; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Drain the hot tub fully before we power it off for the winter. */ + for (tries = 3; !bcm_uart_tx_empty(port) && tries; tries--) +@@ -546,7 +546,7 @@ static void bcm_uart_set_termios(struct uart_port *port, struct ktermios *new, + + uart_update_timeout(port, new->c_cflag, baud); + bcm_uart_enable(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* +@@ -712,9 +712,9 @@ static void bcm_console_write(struct console *co, const char *s, + /* bcm_uart_interrupt() already took the lock */ + locked = 0; + } else if (oops_in_progress) { +- locked = spin_trylock(&port->lock); ++ locked = uart_port_trylock(port); + } else { +- spin_lock(&port->lock); ++ uart_port_lock(port); + locked = 1; + } + +@@ -725,7 +725,7 @@ static void bcm_console_write(struct console *co, const char *s, + wait_for_xmitr(port); + + if (locked) +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + local_irq_restore(flags); + } + +diff --git a/drivers/tty/serial/cpm_uart.c b/drivers/tty/serial/cpm_uart.c +index 626423022..be4af6eda 100644 +--- a/drivers/tty/serial/cpm_uart.c ++++ b/drivers/tty/serial/cpm_uart.c +@@ -569,7 +569,7 @@ static void cpm_uart_set_termios(struct uart_port *port, + if ((termios->c_cflag & CREAD) == 0) + port->read_status_mask &= ~BD_SC_EMPTY; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + if (IS_SMC(pinfo)) { + unsigned int bits = tty_get_frame_size(termios->c_cflag); +@@ -609,7 +609,7 @@ static void cpm_uart_set_termios(struct uart_port *port, + clk_set_rate(pinfo->clk, baud); + else + cpm_setbrg(pinfo->brg - 1, baud); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *cpm_uart_type(struct uart_port *port) +@@ -1386,9 +1386,9 @@ static void cpm_uart_console_write(struct console *co, const char *s, + cpm_uart_early_write(pinfo, s, count, true); + local_irq_restore(flags); + } else { +- spin_lock_irqsave(&pinfo->port.lock, flags); ++ uart_port_lock_irqsave(&pinfo->port, &flags); + cpm_uart_early_write(pinfo, s, count, true); +- spin_unlock_irqrestore(&pinfo->port.lock, flags); ++ uart_port_unlock_irqrestore(&pinfo->port, flags); + } + } + +diff --git a/drivers/tty/serial/digicolor-usart.c b/drivers/tty/serial/digicolor-usart.c +index 128b5479e..5004125f3 100644 +--- a/drivers/tty/serial/digicolor-usart.c ++++ b/drivers/tty/serial/digicolor-usart.c +@@ -133,7 +133,7 @@ static void digicolor_uart_rx(struct uart_port *port) + { + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + while (1) { + u8 status, ch, ch_flag; +@@ -172,7 +172,7 @@ static void digicolor_uart_rx(struct uart_port *port) + ch_flag); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + tty_flip_buffer_push(&port->state->port); + } +@@ -185,7 +185,7 @@ static void digicolor_uart_tx(struct uart_port *port) + if (digicolor_uart_tx_full(port)) + return; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + if (port->x_char) { + writeb_relaxed(port->x_char, port->membase + UA_EMI_REC); +@@ -211,7 +211,7 @@ static void digicolor_uart_tx(struct uart_port *port) + uart_write_wakeup(port); + + out: +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static irqreturn_t digicolor_uart_int(int irq, void *dev_id) +@@ -333,7 +333,7 @@ static void digicolor_uart_set_termios(struct uart_port *port, + port->ignore_status_mask |= UA_STATUS_OVERRUN_ERR + | UA_STATUS_PARITY_ERR | UA_STATUS_FRAME_ERR; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + uart_update_timeout(port, termios->c_cflag, baud); + +@@ -341,7 +341,7 @@ static void digicolor_uart_set_termios(struct uart_port *port, + writeb_relaxed(divisor & 0xff, port->membase + UA_HBAUD_LO); + writeb_relaxed(divisor >> 8, port->membase + UA_HBAUD_HI); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *digicolor_uart_type(struct uart_port *port) +@@ -398,14 +398,14 @@ static void digicolor_uart_console_write(struct console *co, const char *c, + int locked = 1; + + if (oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + uart_console_write(port, c, n, digicolor_uart_console_putchar); + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* Wait for transmitter to become empty */ + do { +diff --git a/drivers/tty/serial/dz.c b/drivers/tty/serial/dz.c +index 667f52e83..6df7af9ed 100644 +--- a/drivers/tty/serial/dz.c ++++ b/drivers/tty/serial/dz.c +@@ -268,9 +268,9 @@ static inline void dz_transmit_chars(struct dz_mux *mux) + } + /* If nothing to do or stopped or hardware stopped. */ + if (uart_circ_empty(xmit) || uart_tx_stopped(&dport->port)) { +- spin_lock(&dport->port.lock); ++ uart_port_lock(&dport->port); + dz_stop_tx(&dport->port); +- spin_unlock(&dport->port.lock); ++ uart_port_unlock(&dport->port); + return; + } + +@@ -287,9 +287,9 @@ static inline void dz_transmit_chars(struct dz_mux *mux) + + /* Are we are done. */ + if (uart_circ_empty(xmit)) { +- spin_lock(&dport->port.lock); ++ uart_port_lock(&dport->port); + dz_stop_tx(&dport->port); +- spin_unlock(&dport->port.lock); ++ uart_port_unlock(&dport->port); + } + } + +@@ -415,14 +415,14 @@ static int dz_startup(struct uart_port *uport) + return ret; + } + +- spin_lock_irqsave(&dport->port.lock, flags); ++ uart_port_lock_irqsave(&dport->port, &flags); + + /* Enable interrupts. */ + tmp = dz_in(dport, DZ_CSR); + tmp |= DZ_RIE | DZ_TIE; + dz_out(dport, DZ_CSR, tmp); + +- spin_unlock_irqrestore(&dport->port.lock, flags); ++ uart_port_unlock_irqrestore(&dport->port, flags); + + return 0; + } +@@ -443,9 +443,9 @@ static void dz_shutdown(struct uart_port *uport) + int irq_guard; + u16 tmp; + +- spin_lock_irqsave(&dport->port.lock, flags); ++ uart_port_lock_irqsave(&dport->port, &flags); + dz_stop_tx(&dport->port); +- spin_unlock_irqrestore(&dport->port.lock, flags); ++ uart_port_unlock_irqrestore(&dport->port, flags); + + irq_guard = atomic_add_return(-1, &mux->irq_guard); + if (!irq_guard) { +@@ -491,14 +491,14 @@ static void dz_break_ctl(struct uart_port *uport, int break_state) + unsigned long flags; + unsigned short tmp, mask = 1 << dport->port.line; + +- spin_lock_irqsave(&uport->lock, flags); ++ uart_port_lock_irqsave(uport, &flags); + tmp = dz_in(dport, DZ_TCR); + if (break_state) + tmp |= mask; + else + tmp &= ~mask; + dz_out(dport, DZ_TCR, tmp); +- spin_unlock_irqrestore(&uport->lock, flags); ++ uart_port_unlock_irqrestore(uport, flags); + } + + static int dz_encode_baud_rate(unsigned int baud) +@@ -608,7 +608,7 @@ static void dz_set_termios(struct uart_port *uport, struct ktermios *termios, + if (termios->c_cflag & CREAD) + cflag |= DZ_RXENAB; + +- spin_lock_irqsave(&dport->port.lock, flags); ++ uart_port_lock_irqsave(&dport->port, &flags); + + uart_update_timeout(uport, termios->c_cflag, baud); + +@@ -631,7 +631,7 @@ static void dz_set_termios(struct uart_port *uport, struct ktermios *termios, + if (termios->c_iflag & IGNBRK) + dport->port.ignore_status_mask |= DZ_BREAK; + +- spin_unlock_irqrestore(&dport->port.lock, flags); ++ uart_port_unlock_irqrestore(&dport->port, flags); + } + + /* +@@ -645,12 +645,12 @@ static void dz_pm(struct uart_port *uport, unsigned int state, + struct dz_port *dport = to_dport(uport); + unsigned long flags; + +- spin_lock_irqsave(&dport->port.lock, flags); ++ uart_port_lock_irqsave(&dport->port, &flags); + if (state < 3) + dz_start_tx(&dport->port); + else + dz_stop_tx(&dport->port); +- spin_unlock_irqrestore(&dport->port.lock, flags); ++ uart_port_unlock_irqrestore(&dport->port, flags); + } + + +@@ -811,7 +811,7 @@ static void dz_console_putchar(struct uart_port *uport, unsigned char ch) + unsigned short csr, tcr, trdy, mask; + int loops = 10000; + +- spin_lock_irqsave(&dport->port.lock, flags); ++ uart_port_lock_irqsave(&dport->port, &flags); + csr = dz_in(dport, DZ_CSR); + dz_out(dport, DZ_CSR, csr & ~DZ_TIE); + tcr = dz_in(dport, DZ_TCR); +@@ -819,7 +819,7 @@ static void dz_console_putchar(struct uart_port *uport, unsigned char ch) + mask = tcr; + dz_out(dport, DZ_TCR, mask); + iob(); +- spin_unlock_irqrestore(&dport->port.lock, flags); ++ uart_port_unlock_irqrestore(&dport->port, flags); + + do { + trdy = dz_in(dport, DZ_CSR); +diff --git a/drivers/tty/serial/fsl_linflexuart.c b/drivers/tty/serial/fsl_linflexuart.c +index 249cb380c..7fa809a40 100644 +--- a/drivers/tty/serial/fsl_linflexuart.c ++++ b/drivers/tty/serial/fsl_linflexuart.c +@@ -203,7 +203,7 @@ static irqreturn_t linflex_txint(int irq, void *dev_id) + struct circ_buf *xmit = &sport->state->xmit; + unsigned long flags; + +- spin_lock_irqsave(&sport->lock, flags); ++ uart_port_lock_irqsave(sport, &flags); + + if (sport->x_char) { + linflex_put_char(sport, sport->x_char); +@@ -217,7 +217,7 @@ static irqreturn_t linflex_txint(int irq, void *dev_id) + + linflex_transmit_buffer(sport); + out: +- spin_unlock_irqrestore(&sport->lock, flags); ++ uart_port_unlock_irqrestore(sport, flags); + return IRQ_HANDLED; + } + +@@ -230,7 +230,7 @@ static irqreturn_t linflex_rxint(int irq, void *dev_id) + unsigned char rx; + bool brk; + +- spin_lock_irqsave(&sport->lock, flags); ++ uart_port_lock_irqsave(sport, &flags); + + status = readl(sport->membase + UARTSR); + while (status & LINFLEXD_UARTSR_RMB) { +@@ -266,7 +266,7 @@ static irqreturn_t linflex_rxint(int irq, void *dev_id) + } + } + +- spin_unlock_irqrestore(&sport->lock, flags); ++ uart_port_unlock_irqrestore(sport, flags); + + tty_flip_buffer_push(port); + +@@ -369,11 +369,11 @@ static int linflex_startup(struct uart_port *port) + int ret = 0; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + linflex_setup_watermark(port); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + ret = devm_request_irq(port->dev, port->irq, linflex_int, 0, + DRIVER_NAME, port); +@@ -386,14 +386,14 @@ static void linflex_shutdown(struct uart_port *port) + unsigned long ier; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* disable interrupts */ + ier = readl(port->membase + LINIER); + ier &= ~(LINFLEXD_LINIER_DRIE | LINFLEXD_LINIER_DTIE); + writel(ier, port->membase + LINIER); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + devm_free_irq(port->dev, port->irq, port); + } +@@ -474,7 +474,7 @@ linflex_set_termios(struct uart_port *port, struct ktermios *termios, + cr &= ~LINFLEXD_UARTCR_PCE; + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + port->read_status_mask = 0; + +@@ -507,7 +507,7 @@ linflex_set_termios(struct uart_port *port, struct ktermios *termios, + + writel(cr1, port->membase + LINCR1); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *linflex_type(struct uart_port *port) +@@ -646,14 +646,14 @@ linflex_console_write(struct console *co, const char *s, unsigned int count) + if (sport->sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock_irqsave(&sport->lock, flags); ++ locked = uart_port_trylock_irqsave(sport, &flags); + else +- spin_lock_irqsave(&sport->lock, flags); ++ uart_port_lock_irqsave(sport, &flags); + + linflex_string_write(sport, s, count); + + if (locked) +- spin_unlock_irqrestore(&sport->lock, flags); ++ uart_port_unlock_irqrestore(sport, flags); + } + + /* +diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c +index 385b41275..71d0cbd74 100644 +--- a/drivers/tty/serial/fsl_lpuart.c ++++ b/drivers/tty/serial/fsl_lpuart.c +@@ -532,9 +532,9 @@ static void lpuart_dma_tx_complete(void *arg) + struct dma_chan *chan = sport->dma_tx_chan; + unsigned long flags; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + if (!sport->dma_tx_in_progress) { +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + return; + } + +@@ -543,7 +543,7 @@ static void lpuart_dma_tx_complete(void *arg) + + uart_xmit_advance(&sport->port, sport->dma_tx_bytes); + sport->dma_tx_in_progress = false; +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) + uart_write_wakeup(&sport->port); +@@ -553,12 +553,12 @@ static void lpuart_dma_tx_complete(void *arg) + return; + } + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + if (!lpuart_stopped_or_empty(&sport->port)) + lpuart_dma_tx(sport); + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static dma_addr_t lpuart_dma_datareg_addr(struct lpuart_port *sport) +@@ -651,7 +651,7 @@ static int lpuart_poll_init(struct uart_port *port) + + sport->port.fifosize = 0; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + /* Disable Rx & Tx */ + writeb(0, sport->port.membase + UARTCR2); + +@@ -675,7 +675,7 @@ static int lpuart_poll_init(struct uart_port *port) + + /* Enable Rx and Tx */ + writeb(UARTCR2_RE | UARTCR2_TE, sport->port.membase + UARTCR2); +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + return 0; + } +@@ -703,7 +703,7 @@ static int lpuart32_poll_init(struct uart_port *port) + + sport->port.fifosize = 0; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + /* Disable Rx & Tx */ + lpuart32_write(&sport->port, 0, UARTCTRL); +@@ -724,7 +724,7 @@ static int lpuart32_poll_init(struct uart_port *port) + + /* Enable Rx and Tx */ + lpuart32_write(&sport->port, UARTCTRL_RE | UARTCTRL_TE, UARTCTRL); +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + return 0; + } +@@ -879,9 +879,9 @@ static unsigned int lpuart32_tx_empty(struct uart_port *port) + + static void lpuart_txint(struct lpuart_port *sport) + { +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + lpuart_transmit_buffer(sport); +- spin_unlock(&sport->port.lock); ++ uart_port_unlock(&sport->port); + } + + static void lpuart_rxint(struct lpuart_port *sport) +@@ -890,7 +890,7 @@ static void lpuart_rxint(struct lpuart_port *sport) + struct tty_port *port = &sport->port.state->port; + unsigned char rx, sr; + +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + + while (!(readb(sport->port.membase + UARTSFIFO) & UARTSFIFO_RXEMPT)) { + flg = TTY_NORMAL; +@@ -956,9 +956,9 @@ static void lpuart_rxint(struct lpuart_port *sport) + + static void lpuart32_txint(struct lpuart_port *sport) + { +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + lpuart32_transmit_buffer(sport); +- spin_unlock(&sport->port.lock); ++ uart_port_unlock(&sport->port); + } + + static void lpuart32_rxint(struct lpuart_port *sport) +@@ -968,7 +968,7 @@ static void lpuart32_rxint(struct lpuart_port *sport) + unsigned long rx, sr; + bool is_break; + +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + + while (!(lpuart32_read(&sport->port, UARTFIFO) & UARTFIFO_RXEMPT)) { + flg = TTY_NORMAL; +@@ -1170,12 +1170,12 @@ static void lpuart_copy_rx_to_tty(struct lpuart_port *sport) + + async_tx_ack(sport->dma_rx_desc); + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + dmastat = dmaengine_tx_status(chan, sport->dma_rx_cookie, &state); + if (dmastat == DMA_ERROR) { + dev_err(sport->port.dev, "Rx DMA transfer failed!\n"); +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + return; + } + +@@ -1244,7 +1244,7 @@ static void lpuart_copy_rx_to_tty(struct lpuart_port *sport) + dma_sync_sg_for_device(chan->device->dev, &sport->rx_sgl, 1, + DMA_FROM_DEVICE); + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + tty_flip_buffer_push(port); + if (!sport->dma_idle_int) +@@ -1335,9 +1335,9 @@ static void lpuart_timer_func(struct timer_list *t) + mod_timer(&sport->lpuart_timer, + jiffies + sport->dma_rx_timeout); + +- if (spin_trylock_irqsave(&sport->port.lock, flags)) { ++ if (uart_port_trylock_irqsave(&sport->port, &flags)) { + sport->last_residue = state.residue; +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + } + +@@ -1802,14 +1802,14 @@ static void lpuart_hw_setup(struct lpuart_port *sport) + { + unsigned long flags; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + lpuart_setup_watermark_enable(sport); + + lpuart_rx_dma_startup(sport); + lpuart_tx_dma_startup(sport); + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static int lpuart_startup(struct uart_port *port) +@@ -1859,7 +1859,7 @@ static void lpuart32_hw_setup(struct lpuart_port *sport) + { + unsigned long flags; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + lpuart32_hw_disable(sport); + +@@ -1869,7 +1869,7 @@ static void lpuart32_hw_setup(struct lpuart_port *sport) + lpuart32_setup_watermark_enable(sport); + lpuart32_configure(sport); + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static int lpuart32_startup(struct uart_port *port) +@@ -1932,7 +1932,7 @@ static void lpuart_shutdown(struct uart_port *port) + unsigned char temp; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* disable Rx/Tx and interrupts */ + temp = readb(port->membase + UARTCR2); +@@ -1940,7 +1940,7 @@ static void lpuart_shutdown(struct uart_port *port) + UARTCR2_TIE | UARTCR2_TCIE | UARTCR2_RIE); + writeb(temp, port->membase + UARTCR2); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + lpuart_dma_shutdown(sport); + } +@@ -1952,7 +1952,7 @@ static void lpuart32_shutdown(struct uart_port *port) + unsigned long temp; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* clear status */ + temp = lpuart32_read(&sport->port, UARTSTAT); +@@ -1969,7 +1969,7 @@ static void lpuart32_shutdown(struct uart_port *port) + UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_RIE | UARTCTRL_SBK); + lpuart32_write(port, temp, UARTCTRL); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + lpuart_dma_shutdown(sport); + } +@@ -2069,7 +2069,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, + if (old && sport->lpuart_dma_rx_use) + lpuart_dma_rx_free(&sport->port); + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + sport->port.read_status_mask = 0; + if (termios->c_iflag & INPCK) +@@ -2124,7 +2124,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, + sport->lpuart_dma_rx_use = false; + } + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static void __lpuart32_serial_setbrg(struct uart_port *port, +@@ -2304,7 +2304,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, + if (old && sport->lpuart_dma_rx_use) + lpuart_dma_rx_free(&sport->port); + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + sport->port.read_status_mask = 0; + if (termios->c_iflag & INPCK) +@@ -2362,7 +2362,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, + sport->lpuart_dma_rx_use = false; + } + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static const char *lpuart_type(struct uart_port *port) +@@ -2480,9 +2480,9 @@ lpuart_console_write(struct console *co, const char *s, unsigned int count) + int locked = 1; + + if (oops_in_progress) +- locked = spin_trylock_irqsave(&sport->port.lock, flags); ++ locked = uart_port_trylock_irqsave(&sport->port, &flags); + else +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + /* first save CR2 and then disable interrupts */ + cr2 = old_cr2 = readb(sport->port.membase + UARTCR2); +@@ -2498,7 +2498,7 @@ lpuart_console_write(struct console *co, const char *s, unsigned int count) + writeb(old_cr2, sport->port.membase + UARTCR2); + + if (locked) +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static void +@@ -2510,9 +2510,9 @@ lpuart32_console_write(struct console *co, const char *s, unsigned int count) + int locked = 1; + + if (oops_in_progress) +- locked = spin_trylock_irqsave(&sport->port.lock, flags); ++ locked = uart_port_trylock_irqsave(&sport->port, &flags); + else +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + /* first save CR2 and then disable interrupts */ + cr = old_cr = lpuart32_read(&sport->port, UARTCTRL); +@@ -2528,7 +2528,7 @@ lpuart32_console_write(struct console *co, const char *s, unsigned int count) + lpuart32_write(&sport->port, old_cr, UARTCTRL); + + if (locked) +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + /* +@@ -3092,7 +3092,7 @@ static int lpuart_suspend(struct device *dev) + uart_suspend_port(&lpuart_reg, &sport->port); + + if (lpuart_uport_is_active(sport)) { +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + if (lpuart_is_32(sport)) { + /* disable Rx/Tx and interrupts */ + temp = lpuart32_read(&sport->port, UARTCTRL); +@@ -3104,7 +3104,7 @@ static int lpuart_suspend(struct device *dev) + temp &= ~(UARTCR2_TE | UARTCR2_TIE | UARTCR2_TCIE); + writeb(temp, sport->port.membase + UARTCR2); + } +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + if (sport->lpuart_dma_rx_use) { + /* +@@ -3117,7 +3117,7 @@ static int lpuart_suspend(struct device *dev) + lpuart_dma_rx_free(&sport->port); + + /* Disable Rx DMA to use UART port as wakeup source */ +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + if (lpuart_is_32(sport)) { + temp = lpuart32_read(&sport->port, UARTBAUD); + lpuart32_write(&sport->port, temp & ~UARTBAUD_RDMAE, +@@ -3126,11 +3126,11 @@ static int lpuart_suspend(struct device *dev) + writeb(readb(sport->port.membase + UARTCR5) & + ~UARTCR5_RDMAS, sport->port.membase + UARTCR5); + } +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + if (sport->lpuart_dma_tx_use) { +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + if (lpuart_is_32(sport)) { + temp = lpuart32_read(&sport->port, UARTBAUD); + temp &= ~UARTBAUD_TDMAE; +@@ -3140,7 +3140,7 @@ static int lpuart_suspend(struct device *dev) + temp &= ~UARTCR5_TDMAS; + writeb(temp, sport->port.membase + UARTCR5); + } +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + sport->dma_tx_in_progress = false; + dmaengine_terminate_sync(sport->dma_tx_chan); + } +diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c +index 819f957b6..a75eafbcb 100644 +--- a/drivers/tty/serial/icom.c ++++ b/drivers/tty/serial/icom.c +@@ -929,7 +929,7 @@ static inline void check_modem_status(struct icom_port *icom_port) + char delta_status; + unsigned char status; + +- spin_lock(&icom_port->uart_port.lock); ++ uart_port_lock(&icom_port->uart_port); + + /*modem input register */ + status = readb(&icom_port->dram->isr); +@@ -951,7 +951,7 @@ static inline void check_modem_status(struct icom_port *icom_port) + port.delta_msr_wait); + old_status = status; + } +- spin_unlock(&icom_port->uart_port.lock); ++ uart_port_unlock(&icom_port->uart_port); + } + + static void xmit_interrupt(u16 port_int_reg, struct icom_port *icom_port) +@@ -1093,7 +1093,7 @@ static void process_interrupt(u16 port_int_reg, + struct icom_port *icom_port) + { + +- spin_lock(&icom_port->uart_port.lock); ++ uart_port_lock(&icom_port->uart_port); + trace(icom_port, "INTERRUPT", port_int_reg); + + if (port_int_reg & (INT_XMIT_COMPLETED | INT_XMIT_DISABLED)) +@@ -1102,7 +1102,7 @@ static void process_interrupt(u16 port_int_reg, + if (port_int_reg & INT_RCV_COMPLETED) + recv_interrupt(port_int_reg, icom_port); + +- spin_unlock(&icom_port->uart_port.lock); ++ uart_port_unlock(&icom_port->uart_port); + } + + static irqreturn_t icom_interrupt(int irq, void *dev_id) +@@ -1186,14 +1186,14 @@ static unsigned int icom_tx_empty(struct uart_port *port) + int ret; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (le16_to_cpu(icom_port->statStg->xmit[0].flags) & + SA_FLAGS_READY_TO_XMIT) + ret = TIOCSER_TEMT; + else + ret = 0; + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + return ret; + } + +@@ -1276,7 +1276,7 @@ static void icom_send_xchar(struct uart_port *port, char ch) + + /* wait .1 sec to send char */ + for (index = 0; index < 10; index++) { +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + xdata = readb(&icom_port->dram->xchar); + if (xdata == 0x00) { + trace(icom_port, "QUICK_WRITE", 0); +@@ -1284,10 +1284,10 @@ static void icom_send_xchar(struct uart_port *port, char ch) + + /* flush write operation */ + xdata = readb(&icom_port->dram->xchar); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + break; + } +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + msleep(10); + } + } +@@ -1307,7 +1307,7 @@ static void icom_break(struct uart_port *port, int break_state) + unsigned char cmdReg; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + trace(icom_port, "BREAK", 0); + cmdReg = readb(&icom_port->dram->CmdReg); + if (break_state == -1) { +@@ -1315,7 +1315,7 @@ static void icom_break(struct uart_port *port, int break_state) + } else { + writeb(cmdReg & ~CMD_SND_BREAK, &icom_port->dram->CmdReg); + } +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int icom_open(struct uart_port *port) +@@ -1365,7 +1365,7 @@ static void icom_set_termios(struct uart_port *port, struct ktermios *termios, + unsigned long offset; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + trace(icom_port, "CHANGE_SPEED", 0); + + cflag = termios->c_cflag; +@@ -1516,7 +1516,7 @@ static void icom_set_termios(struct uart_port *port, struct ktermios *termios, + trace(icom_port, "XR_ENAB", 0); + writeb(CMD_XMIT_RCV_ENABLE, &icom_port->dram->CmdReg); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *icom_type(struct uart_port *port) +diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c +index c77831e91..66420a992 100644 +--- a/drivers/tty/serial/imx.c ++++ b/drivers/tty/serial/imx.c +@@ -584,7 +584,7 @@ static void imx_uart_dma_tx_callback(void *data) + unsigned long flags; + u32 ucr1; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + dma_unmap_sg(sport->port.dev, sgl, sport->dma_tx_nents, DMA_TO_DEVICE); + +@@ -609,7 +609,7 @@ static void imx_uart_dma_tx_callback(void *data) + imx_uart_writel(sport, ucr4, UCR4); + } + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + /* called with port.lock taken and irqs off */ +@@ -780,11 +780,11 @@ static irqreturn_t imx_uart_rtsint(int irq, void *dev_id) + struct imx_port *sport = dev_id; + irqreturn_t ret; + +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + + ret = __imx_uart_rtsint(irq, dev_id); + +- spin_unlock(&sport->port.lock); ++ uart_port_unlock(&sport->port); + + return ret; + } +@@ -793,9 +793,9 @@ static irqreturn_t imx_uart_txint(int irq, void *dev_id) + { + struct imx_port *sport = dev_id; + +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + imx_uart_transmit_buffer(sport); +- spin_unlock(&sport->port.lock); ++ uart_port_unlock(&sport->port); + return IRQ_HANDLED; + } + +@@ -909,11 +909,11 @@ static irqreturn_t imx_uart_rxint(int irq, void *dev_id) + struct imx_port *sport = dev_id; + irqreturn_t ret; + +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + + ret = __imx_uart_rxint(irq, dev_id); + +- spin_unlock(&sport->port.lock); ++ uart_port_unlock(&sport->port); + + return ret; + } +@@ -976,7 +976,7 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id) + unsigned int usr1, usr2, ucr1, ucr2, ucr3, ucr4; + irqreturn_t ret = IRQ_NONE; + +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + + usr1 = imx_uart_readl(sport, USR1); + usr2 = imx_uart_readl(sport, USR2); +@@ -1046,7 +1046,7 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id) + ret = IRQ_HANDLED; + } + +- spin_unlock(&sport->port.lock); ++ uart_port_unlock(&sport->port); + + return ret; + } +@@ -1129,7 +1129,7 @@ static void imx_uart_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + u32 ucr1; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + ucr1 = imx_uart_readl(sport, UCR1) & ~UCR1_SNDBRK; + +@@ -1138,7 +1138,7 @@ static void imx_uart_break_ctl(struct uart_port *port, int break_state) + + imx_uart_writel(sport, ucr1, UCR1); + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + /* +@@ -1151,9 +1151,9 @@ static void imx_uart_timeout(struct timer_list *t) + unsigned long flags; + + if (sport->port.state) { +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + imx_uart_mctrl_check(sport); +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + mod_timer(&sport->timer, jiffies + MCTRL_TIMEOUT); + } +@@ -1183,9 +1183,9 @@ static void imx_uart_dma_rx_callback(void *data) + status = dmaengine_tx_status(chan, sport->rx_cookie, &state); + + if (status == DMA_ERROR) { +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + imx_uart_clear_rx_errors(sport); +- spin_unlock(&sport->port.lock); ++ uart_port_unlock(&sport->port); + return; + } + +@@ -1214,9 +1214,9 @@ static void imx_uart_dma_rx_callback(void *data) + r_bytes = rx_ring->head - rx_ring->tail; + + /* If we received something, check for 0xff flood */ +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + imx_uart_check_flood(sport, imx_uart_readl(sport, USR2)); +- spin_unlock(&sport->port.lock); ++ uart_port_unlock(&sport->port); + + if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ)) { + +@@ -1474,7 +1474,7 @@ static int imx_uart_startup(struct uart_port *port) + if (!uart_console(port) && imx_uart_dma_init(sport) == 0) + dma_is_inited = 1; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + /* Reset fifo's and state machines */ + imx_uart_soft_reset(sport); +@@ -1547,7 +1547,7 @@ static int imx_uart_startup(struct uart_port *port) + + imx_uart_disable_loopback_rs485(sport); + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + return 0; + } +@@ -1572,21 +1572,21 @@ static void imx_uart_shutdown(struct uart_port *port) + sport->dma_is_rxing = 0; + } + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + imx_uart_stop_tx(port); + imx_uart_stop_rx(port); + imx_uart_disable_dma(sport); +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + imx_uart_dma_exit(sport); + } + + mctrl_gpio_disable_ms(sport->gpios); + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + ucr2 = imx_uart_readl(sport, UCR2); + ucr2 &= ~(UCR2_TXEN | UCR2_ATEN); + imx_uart_writel(sport, ucr2, UCR2); +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + /* + * Stop our timer. +@@ -1597,7 +1597,7 @@ static void imx_uart_shutdown(struct uart_port *port) + * Disable all interrupts, port and break condition. + */ + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + ucr1 = imx_uart_readl(sport, UCR1); + ucr1 &= ~(UCR1_TRDYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_RXDMAEN | +@@ -1619,7 +1619,7 @@ static void imx_uart_shutdown(struct uart_port *port) + ucr4 &= ~UCR4_TCEN; + imx_uart_writel(sport, ucr4, UCR4); + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + clk_disable_unprepare(sport->clk_per); + clk_disable_unprepare(sport->clk_ipg); +@@ -1682,7 +1682,7 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, + baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16); + quot = uart_get_divisor(port, baud); + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + /* + * Read current UCR2 and save it for future use, then clear all the bits +@@ -1810,7 +1810,7 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, + if (UART_ENABLE_MS(&sport->port, termios->c_cflag)) + imx_uart_enable_ms(&sport->port); + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static const char *imx_uart_type(struct uart_port *port) +@@ -1872,7 +1872,7 @@ static int imx_uart_poll_init(struct uart_port *port) + + imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT); + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + /* + * Be careful about the order of enabling bits here. First enable the +@@ -1900,7 +1900,7 @@ static int imx_uart_poll_init(struct uart_port *port) + imx_uart_writel(sport, ucr1 | UCR1_RRDYEN, UCR1); + imx_uart_writel(sport, ucr2 | UCR2_ATEN, UCR2); + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + return 0; + } +@@ -2015,9 +2015,9 @@ imx_uart_console_write(struct console *co, const char *s, unsigned int count) + if (sport->port.sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock_irqsave(&sport->port.lock, flags); ++ locked = uart_port_trylock_irqsave(&sport->port, &flags); + else +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + /* + * First, save UCR1/2/3 and then disable interrupts +@@ -2045,7 +2045,7 @@ imx_uart_console_write(struct console *co, const char *s, unsigned int count) + imx_uart_ucrs_restore(sport, &old_ucr); + + if (locked) +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + /* +@@ -2203,10 +2203,10 @@ static enum hrtimer_restart imx_trigger_start_tx(struct hrtimer *t) + struct imx_port *sport = container_of(t, struct imx_port, trigger_start_tx); + unsigned long flags; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + if (sport->tx_state == WAIT_AFTER_RTS) + imx_uart_start_tx(&sport->port); +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + return HRTIMER_NORESTART; + } +@@ -2216,10 +2216,10 @@ static enum hrtimer_restart imx_trigger_stop_tx(struct hrtimer *t) + struct imx_port *sport = container_of(t, struct imx_port, trigger_stop_tx); + unsigned long flags; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + if (sport->tx_state == WAIT_AFTER_SEND) + imx_uart_stop_tx(&sport->port); +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + return HRTIMER_NORESTART; + } +@@ -2486,9 +2486,9 @@ static void imx_uart_restore_context(struct imx_port *sport) + { + unsigned long flags; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + if (!sport->context_saved) { +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + return; + } + +@@ -2503,7 +2503,7 @@ static void imx_uart_restore_context(struct imx_port *sport) + imx_uart_writel(sport, sport->saved_reg[2], UCR3); + imx_uart_writel(sport, sport->saved_reg[3], UCR4); + sport->context_saved = false; +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static void imx_uart_save_context(struct imx_port *sport) +@@ -2511,7 +2511,7 @@ static void imx_uart_save_context(struct imx_port *sport) + unsigned long flags; + + /* Save necessary regs */ +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + sport->saved_reg[0] = imx_uart_readl(sport, UCR1); + sport->saved_reg[1] = imx_uart_readl(sport, UCR2); + sport->saved_reg[2] = imx_uart_readl(sport, UCR3); +@@ -2523,7 +2523,7 @@ static void imx_uart_save_context(struct imx_port *sport) + sport->saved_reg[8] = imx_uart_readl(sport, UBMR); + sport->saved_reg[9] = imx_uart_readl(sport, IMX21_UTS); + sport->context_saved = true; +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static void imx_uart_enable_wakeup(struct imx_port *sport, bool on) +diff --git a/drivers/tty/serial/ip22zilog.c b/drivers/tty/serial/ip22zilog.c +index 845ff706b..320b29cd4 100644 +--- a/drivers/tty/serial/ip22zilog.c ++++ b/drivers/tty/serial/ip22zilog.c +@@ -432,7 +432,7 @@ static irqreturn_t ip22zilog_interrupt(int irq, void *dev_id) + unsigned char r3; + bool push = false; + +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + r3 = read_zsreg(channel, R3); + + /* Channel A */ +@@ -448,7 +448,7 @@ static irqreturn_t ip22zilog_interrupt(int irq, void *dev_id) + if (r3 & CHATxIP) + ip22zilog_transmit_chars(up, channel); + } +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + + if (push) + tty_flip_buffer_push(&up->port.state->port); +@@ -458,7 +458,7 @@ static irqreturn_t ip22zilog_interrupt(int irq, void *dev_id) + channel = ZILOG_CHANNEL_FROM_PORT(&up->port); + push = false; + +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) { + writeb(RES_H_IUS, &channel->control); + ZSDELAY(); +@@ -471,7 +471,7 @@ static irqreturn_t ip22zilog_interrupt(int irq, void *dev_id) + if (r3 & CHBTxIP) + ip22zilog_transmit_chars(up, channel); + } +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + + if (push) + tty_flip_buffer_push(&up->port.state->port); +@@ -504,11 +504,11 @@ static unsigned int ip22zilog_tx_empty(struct uart_port *port) + unsigned char status; + unsigned int ret; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + status = ip22zilog_read_channel_status(port); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (status & Tx_BUF_EMP) + ret = TIOCSER_TEMT; +@@ -664,7 +664,7 @@ static void ip22zilog_break_ctl(struct uart_port *port, int break_state) + else + clear_bits |= SND_BRK; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + new_reg = (up->curregs[R5] | set_bits) & ~clear_bits; + if (new_reg != up->curregs[R5]) { +@@ -674,7 +674,7 @@ static void ip22zilog_break_ctl(struct uart_port *port, int break_state) + write_zsreg(channel, R5, up->curregs[R5]); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void __ip22zilog_reset(struct uart_ip22zilog_port *up) +@@ -735,9 +735,9 @@ static int ip22zilog_startup(struct uart_port *port) + if (ZS_IS_CONS(up)) + return 0; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + __ip22zilog_startup(up); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + return 0; + } + +@@ -775,7 +775,7 @@ static void ip22zilog_shutdown(struct uart_port *port) + if (ZS_IS_CONS(up)) + return; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + channel = ZILOG_CHANNEL_FROM_PORT(port); + +@@ -788,7 +788,7 @@ static void ip22zilog_shutdown(struct uart_port *port) + up->curregs[R5] &= ~SND_BRK; + ip22zilog_maybe_update_regs(up, channel); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* Shared by TTY driver and serial console setup. The port lock is held +@@ -880,7 +880,7 @@ ip22zilog_set_termios(struct uart_port *port, struct ktermios *termios, + + baud = uart_get_baud_rate(port, termios, old, 1200, 76800); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + brg = BPS_TO_BRG(baud, ZS_CLOCK / ZS_CLOCK_DIVISOR); + +@@ -894,7 +894,7 @@ ip22zilog_set_termios(struct uart_port *port, struct ktermios *termios, + ip22zilog_maybe_update_regs(up, ZILOG_CHANNEL_FROM_PORT(port)); + uart_update_timeout(port, termios->c_cflag, baud); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static const char *ip22zilog_type(struct uart_port *port) +@@ -1016,10 +1016,10 @@ ip22zilog_console_write(struct console *con, const char *s, unsigned int count) + struct uart_ip22zilog_port *up = &ip22zilog_port_table[con->index]; + unsigned long flags; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + uart_console_write(&up->port, s, count, ip22zilog_put_char); + udelay(2); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static int __init ip22zilog_console_setup(struct console *con, char *options) +@@ -1034,13 +1034,13 @@ static int __init ip22zilog_console_setup(struct console *con, char *options) + + printk(KERN_INFO "Console: ttyS%d (IP22-Zilog)\n", con->index); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + up->curregs[R15] |= BRKIE; + + __ip22zilog_startup(up); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + if (options) + uart_parse_options(options, &baud, &parity, &bits, &flow); +diff --git a/drivers/tty/serial/jsm/jsm_neo.c b/drivers/tty/serial/jsm/jsm_neo.c +index 0c78f6627..2bd640428 100644 +--- a/drivers/tty/serial/jsm/jsm_neo.c ++++ b/drivers/tty/serial/jsm/jsm_neo.c +@@ -816,9 +816,9 @@ static void neo_parse_isr(struct jsm_board *brd, u32 port) + /* Parse any modem signal changes */ + jsm_dbg(INTR, &ch->ch_bd->pci_dev, + "MOD_STAT: sending to parse_modem_sigs\n"); +- spin_lock_irqsave(&ch->uart_port.lock, lock_flags); ++ uart_port_lock_irqsave(&ch->uart_port, &lock_flags); + neo_parse_modem(ch, readb(&ch->ch_neo_uart->msr)); +- spin_unlock_irqrestore(&ch->uart_port.lock, lock_flags); ++ uart_port_unlock_irqrestore(&ch->uart_port, lock_flags); + } + } + +diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c +index 222afc270..ce0fef7e2 100644 +--- a/drivers/tty/serial/jsm/jsm_tty.c ++++ b/drivers/tty/serial/jsm/jsm_tty.c +@@ -152,14 +152,14 @@ static void jsm_tty_send_xchar(struct uart_port *port, char ch) + container_of(port, struct jsm_channel, uart_port); + struct ktermios *termios; + +- spin_lock_irqsave(&port->lock, lock_flags); ++ uart_port_lock_irqsave(port, &lock_flags); + termios = &port->state->port.tty->termios; + if (ch == termios->c_cc[VSTART]) + channel->ch_bd->bd_ops->send_start_character(channel); + + if (ch == termios->c_cc[VSTOP]) + channel->ch_bd->bd_ops->send_stop_character(channel); +- spin_unlock_irqrestore(&port->lock, lock_flags); ++ uart_port_unlock_irqrestore(port, lock_flags); + } + + static void jsm_tty_stop_rx(struct uart_port *port) +@@ -176,13 +176,13 @@ static void jsm_tty_break(struct uart_port *port, int break_state) + struct jsm_channel *channel = + container_of(port, struct jsm_channel, uart_port); + +- spin_lock_irqsave(&port->lock, lock_flags); ++ uart_port_lock_irqsave(port, &lock_flags); + if (break_state == -1) + channel->ch_bd->bd_ops->send_break(channel); + else + channel->ch_bd->bd_ops->clear_break(channel); + +- spin_unlock_irqrestore(&port->lock, lock_flags); ++ uart_port_unlock_irqrestore(port, lock_flags); + } + + static int jsm_tty_open(struct uart_port *port) +@@ -241,7 +241,7 @@ static int jsm_tty_open(struct uart_port *port) + channel->ch_cached_lsr = 0; + channel->ch_stops_sent = 0; + +- spin_lock_irqsave(&port->lock, lock_flags); ++ uart_port_lock_irqsave(port, &lock_flags); + termios = &port->state->port.tty->termios; + channel->ch_c_cflag = termios->c_cflag; + channel->ch_c_iflag = termios->c_iflag; +@@ -261,7 +261,7 @@ static int jsm_tty_open(struct uart_port *port) + jsm_carrier(channel); + + channel->ch_open_count++; +- spin_unlock_irqrestore(&port->lock, lock_flags); ++ uart_port_unlock_irqrestore(port, lock_flags); + + jsm_dbg(OPEN, &channel->ch_bd->pci_dev, "finish\n"); + return 0; +@@ -307,7 +307,7 @@ static void jsm_tty_set_termios(struct uart_port *port, + struct jsm_channel *channel = + container_of(port, struct jsm_channel, uart_port); + +- spin_lock_irqsave(&port->lock, lock_flags); ++ uart_port_lock_irqsave(port, &lock_flags); + channel->ch_c_cflag = termios->c_cflag; + channel->ch_c_iflag = termios->c_iflag; + channel->ch_c_oflag = termios->c_oflag; +@@ -317,7 +317,7 @@ static void jsm_tty_set_termios(struct uart_port *port, + + channel->ch_bd->bd_ops->param(channel); + jsm_carrier(channel); +- spin_unlock_irqrestore(&port->lock, lock_flags); ++ uart_port_unlock_irqrestore(port, lock_flags); + } + + static const char *jsm_tty_type(struct uart_port *port) +diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c +index d881cdd2a..a25ab1efe 100644 +--- a/drivers/tty/serial/liteuart.c ++++ b/drivers/tty/serial/liteuart.c +@@ -139,13 +139,13 @@ static irqreturn_t liteuart_interrupt(int irq, void *data) + * if polling, the context would be "in_serving_softirq", so use + * irq[save|restore] spin_lock variants to cover all possibilities + */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + isr = litex_read8(port->membase + OFF_EV_PENDING) & uart->irq_reg; + if (isr & EV_RX) + liteuart_rx_chars(port); + if (isr & EV_TX) + liteuart_tx_chars(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return IRQ_RETVAL(isr); + } +@@ -195,10 +195,10 @@ static int liteuart_startup(struct uart_port *port) + } + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + /* only enabling rx irqs during startup */ + liteuart_update_irq_reg(port, true, EV_RX); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (!port->irq) { + timer_setup(&uart->timer, liteuart_timer, 0); +@@ -213,9 +213,9 @@ static void liteuart_shutdown(struct uart_port *port) + struct liteuart_port *uart = to_liteuart_port(port); + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + liteuart_update_irq_reg(port, false, EV_RX | EV_TX); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (port->irq) + free_irq(port->irq, port); +@@ -229,13 +229,13 @@ static void liteuart_set_termios(struct uart_port *port, struct ktermios *new, + unsigned int baud; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* update baudrate */ + baud = uart_get_baud_rate(port, new, old, 0, 460800); + uart_update_timeout(port, new->c_cflag, baud); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *liteuart_type(struct uart_port *port) +@@ -382,9 +382,9 @@ static void liteuart_console_write(struct console *co, const char *s, + uart = (struct liteuart_port *)xa_load(&liteuart_array, co->index); + port = &uart->port; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + uart_console_write(port, s, count, liteuart_putchar); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int liteuart_console_setup(struct console *co, char *options) +diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c +index b38fe4728..5149a947b 100644 +--- a/drivers/tty/serial/lpc32xx_hs.c ++++ b/drivers/tty/serial/lpc32xx_hs.c +@@ -140,15 +140,15 @@ static void lpc32xx_hsuart_console_write(struct console *co, const char *s, + if (up->port.sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock(&up->port.lock); ++ locked = uart_port_trylock(&up->port); + else +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + + uart_console_write(&up->port, s, count, lpc32xx_hsuart_console_putchar); + wait_for_xmit_empty(&up->port); + + if (locked) +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + local_irq_restore(flags); + } + +@@ -298,7 +298,7 @@ static irqreturn_t serial_lpc32xx_interrupt(int irq, void *dev_id) + struct tty_port *tport = &port->state->port; + u32 status; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + /* Read UART status and clear latched interrupts */ + status = readl(LPC32XX_HSUART_IIR(port->membase)); +@@ -333,7 +333,7 @@ static irqreturn_t serial_lpc32xx_interrupt(int irq, void *dev_id) + __serial_lpc32xx_tx(port); + } + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -404,14 +404,14 @@ static void serial_lpc32xx_break_ctl(struct uart_port *port, + unsigned long flags; + u32 tmp; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + tmp = readl(LPC32XX_HSUART_CTRL(port->membase)); + if (break_state != 0) + tmp |= LPC32XX_HSU_BREAK; + else + tmp &= ~LPC32XX_HSU_BREAK; + writel(tmp, LPC32XX_HSUART_CTRL(port->membase)); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* port->lock is not held. */ +@@ -421,7 +421,7 @@ static int serial_lpc32xx_startup(struct uart_port *port) + unsigned long flags; + u32 tmp; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + __serial_uart_flush(port); + +@@ -441,7 +441,7 @@ static int serial_lpc32xx_startup(struct uart_port *port) + + lpc32xx_loopback_set(port->mapbase, 0); /* get out of loopback mode */ + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + retval = request_irq(port->irq, serial_lpc32xx_interrupt, + 0, MODNAME, port); +@@ -458,7 +458,7 @@ static void serial_lpc32xx_shutdown(struct uart_port *port) + u32 tmp; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + tmp = LPC32XX_HSU_TX_TL8B | LPC32XX_HSU_RX_TL32B | + LPC32XX_HSU_OFFSET(20) | LPC32XX_HSU_TMO_INACT_4B; +@@ -466,7 +466,7 @@ static void serial_lpc32xx_shutdown(struct uart_port *port) + + lpc32xx_loopback_set(port->mapbase, 1); /* go to loopback mode */ + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + free_irq(port->irq, port); + } +@@ -491,7 +491,7 @@ static void serial_lpc32xx_set_termios(struct uart_port *port, + + quot = __serial_get_clock_div(port->uartclk, baud); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Ignore characters? */ + tmp = readl(LPC32XX_HSUART_CTRL(port->membase)); +@@ -505,7 +505,7 @@ static void serial_lpc32xx_set_termios(struct uart_port *port, + + uart_update_timeout(port, termios->c_cflag, baud); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* Don't rewrite B0 */ + if (tty_termios_baud_rate(termios)) +diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c +index 69da24565..73910c54d 100644 +--- a/drivers/tty/serial/ma35d1_serial.c ++++ b/drivers/tty/serial/ma35d1_serial.c +@@ -269,16 +269,16 @@ static void receive_chars(struct uart_ma35d1_port *up) + if (uart_handle_sysrq_char(&up->port, ch)) + continue; + +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + uart_insert_char(&up->port, fsr, MA35_FSR_RX_OVER_IF, ch, flag); +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + + fsr = serial_in(up, MA35_FSR_REG); + } while (!(fsr & MA35_FSR_RX_EMPTY) && (max_count-- > 0)); + +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + tty_flip_buffer_push(&up->port.state->port); +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + } + + static irqreturn_t ma35d1serial_interrupt(int irq, void *dev_id) +@@ -364,14 +364,14 @@ static void ma35d1serial_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + u32 lcr; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + lcr = serial_in(up, MA35_LCR_REG); + if (break_state != 0) + lcr |= MA35_LCR_BREAK; + else + lcr &= ~MA35_LCR_BREAK; + serial_out(up, MA35_LCR_REG, lcr); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static int ma35d1serial_startup(struct uart_port *port) +@@ -441,7 +441,7 @@ static void ma35d1serial_set_termios(struct uart_port *port, + * Ok, we're now changing the port state. Do it with + * interrupts disabled. + */ +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + up->port.read_status_mask = MA35_FSR_RX_OVER_IF; + if (termios->c_iflag & INPCK) +@@ -475,7 +475,7 @@ static void ma35d1serial_set_termios(struct uart_port *port, + + serial_out(up, MA35_LCR_REG, lcr); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static const char *ma35d1serial_type(struct uart_port *port) +@@ -568,9 +568,9 @@ static void ma35d1serial_console_write(struct console *co, const char *s, u32 co + if (up->port.sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock_irqsave(&up->port.lock, flags); ++ locked = uart_port_trylock_irqsave(&up->port, &flags); + else +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* + * First save the IER then disable the interrupts +@@ -584,7 +584,7 @@ static void ma35d1serial_console_write(struct console *co, const char *s, u32 co + serial_out(up, MA35_IER_REG, ier); + + if (locked) +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static int __init ma35d1serial_console_setup(struct console *co, char *options) +diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c +index 1666ce012..91b15243f 100644 +--- a/drivers/tty/serial/mcf.c ++++ b/drivers/tty/serial/mcf.c +@@ -135,12 +135,12 @@ static void mcf_break_ctl(struct uart_port *port, int break_state) + { + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (break_state == -1) + writeb(MCFUART_UCR_CMDBREAKSTART, port->membase + MCFUART_UCR); + else + writeb(MCFUART_UCR_CMDBREAKSTOP, port->membase + MCFUART_UCR); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /****************************************************************************/ +@@ -150,7 +150,7 @@ static int mcf_startup(struct uart_port *port) + struct mcf_uart *pp = container_of(port, struct mcf_uart, port); + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Reset UART, get it into known state... */ + writeb(MCFUART_UCR_CMDRESETRX, port->membase + MCFUART_UCR); +@@ -164,7 +164,7 @@ static int mcf_startup(struct uart_port *port) + pp->imr = MCFUART_UIR_RXREADY; + writeb(pp->imr, port->membase + MCFUART_UIMR); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return 0; + } +@@ -176,7 +176,7 @@ static void mcf_shutdown(struct uart_port *port) + struct mcf_uart *pp = container_of(port, struct mcf_uart, port); + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Disable all interrupts now */ + pp->imr = 0; +@@ -186,7 +186,7 @@ static void mcf_shutdown(struct uart_port *port) + writeb(MCFUART_UCR_CMDRESETRX, port->membase + MCFUART_UCR); + writeb(MCFUART_UCR_CMDRESETTX, port->membase + MCFUART_UCR); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /****************************************************************************/ +@@ -252,7 +252,7 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios, + mr2 |= MCFUART_MR2_TXCTS; + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (port->rs485.flags & SER_RS485_ENABLED) { + dev_dbg(port->dev, "Setting UART to RS485\n"); + mr2 |= MCFUART_MR2_TXRTS; +@@ -273,7 +273,7 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios, + port->membase + MCFUART_UCSR); + writeb(MCFUART_UCR_RXENABLE | MCFUART_UCR_TXENABLE, + port->membase + MCFUART_UCR); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /****************************************************************************/ +@@ -350,7 +350,7 @@ static irqreturn_t mcf_interrupt(int irq, void *data) + + isr = readb(port->membase + MCFUART_UISR) & pp->imr; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + if (isr & MCFUART_UIR_RXREADY) { + mcf_rx_chars(pp); + ret = IRQ_HANDLED; +@@ -359,7 +359,7 @@ static irqreturn_t mcf_interrupt(int irq, void *data) + mcf_tx_chars(pp); + ret = IRQ_HANDLED; + } +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return ret; + } +diff --git a/drivers/tty/serial/men_z135_uart.c b/drivers/tty/serial/men_z135_uart.c +index d2502aaa3..8048fa542 100644 +--- a/drivers/tty/serial/men_z135_uart.c ++++ b/drivers/tty/serial/men_z135_uart.c +@@ -392,7 +392,7 @@ static irqreturn_t men_z135_intr(int irq, void *data) + if (!irq_id) + goto out; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + /* It's save to write to IIR[7:6] RXC[9:8] */ + iowrite8(irq_id, port->membase + MEN_Z135_STAT_REG); + +@@ -418,7 +418,7 @@ static irqreturn_t men_z135_intr(int irq, void *data) + handled = true; + } + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + out: + return IRQ_RETVAL(handled); + } +@@ -708,7 +708,7 @@ static void men_z135_set_termios(struct uart_port *port, + + baud = uart_get_baud_rate(port, termios, old, 0, uart_freq / 16); + +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + if (tty_termios_baud_rate(termios)) + tty_termios_encode_baud_rate(termios, baud, baud); + +@@ -716,7 +716,7 @@ static void men_z135_set_termios(struct uart_port *port, + iowrite32(bd_reg, port->membase + MEN_Z135_BAUD_REG); + + uart_update_timeout(port, termios->c_cflag, baud); +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + } + + static const char *men_z135_type(struct uart_port *port) +diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c +index 9388b9dde..4c1d2089a 100644 +--- a/drivers/tty/serial/meson_uart.c ++++ b/drivers/tty/serial/meson_uart.c +@@ -129,14 +129,14 @@ static void meson_uart_shutdown(struct uart_port *port) + + free_irq(port->irq, port); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + val = readl(port->membase + AML_UART_CONTROL); + val &= ~AML_UART_RX_EN; + val &= ~(AML_UART_RX_INT_EN | AML_UART_TX_INT_EN); + writel(val, port->membase + AML_UART_CONTROL); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void meson_uart_start_tx(struct uart_port *port) +@@ -238,7 +238,7 @@ static irqreturn_t meson_uart_interrupt(int irq, void *dev_id) + { + struct uart_port *port = (struct uart_port *)dev_id; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + if (!(readl(port->membase + AML_UART_STATUS) & AML_UART_RX_EMPTY)) + meson_receive_chars(port); +@@ -248,7 +248,7 @@ static irqreturn_t meson_uart_interrupt(int irq, void *dev_id) + meson_uart_start_tx(port); + } + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -284,7 +284,7 @@ static int meson_uart_startup(struct uart_port *port) + u32 val; + int ret = 0; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + val = readl(port->membase + AML_UART_CONTROL); + val |= AML_UART_CLEAR_ERR; +@@ -301,7 +301,7 @@ static int meson_uart_startup(struct uart_port *port) + val = (AML_UART_RECV_IRQ(1) | AML_UART_XMIT_IRQ(port->fifosize / 2)); + writel(val, port->membase + AML_UART_MISC); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + ret = request_irq(port->irq, meson_uart_interrupt, 0, + port->name, port); +@@ -341,7 +341,7 @@ static void meson_uart_set_termios(struct uart_port *port, + unsigned long flags; + u32 val; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + cflags = termios->c_cflag; + iflags = termios->c_iflag; +@@ -405,7 +405,7 @@ static void meson_uart_set_termios(struct uart_port *port, + AML_UART_FRAME_ERR; + + uart_update_timeout(port, termios->c_cflag, baud); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int meson_uart_verify_port(struct uart_port *port, +@@ -464,14 +464,14 @@ static int meson_uart_poll_get_char(struct uart_port *port) + u32 c; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + if (readl(port->membase + AML_UART_STATUS) & AML_UART_RX_EMPTY) + c = NO_POLL_CHAR; + else + c = readl(port->membase + AML_UART_RFIFO); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return c; + } +@@ -482,7 +482,7 @@ static void meson_uart_poll_put_char(struct uart_port *port, unsigned char c) + u32 reg; + int ret; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Wait until FIFO is empty or timeout */ + ret = readl_poll_timeout_atomic(port->membase + AML_UART_STATUS, reg, +@@ -506,7 +506,7 @@ static void meson_uart_poll_put_char(struct uart_port *port, unsigned char c) + dev_err(port->dev, "Timeout waiting for UART TX EMPTY\n"); + + out: +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + #endif /* CONFIG_CONSOLE_POLL */ +@@ -563,9 +563,9 @@ static void meson_serial_port_write(struct uart_port *port, const char *s, + if (port->sysrq) { + locked = 0; + } else if (oops_in_progress) { +- locked = spin_trylock(&port->lock); ++ locked = uart_port_trylock(port); + } else { +- spin_lock(&port->lock); ++ uart_port_lock(port); + locked = 1; + } + +@@ -577,7 +577,7 @@ static void meson_serial_port_write(struct uart_port *port, const char *s, + writel(val, port->membase + AML_UART_CONTROL); + + if (locked) +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + local_irq_restore(flags); + } + +diff --git a/drivers/tty/serial/milbeaut_usio.c b/drivers/tty/serial/milbeaut_usio.c +index 70a910085..db3b81f2a 100644 +--- a/drivers/tty/serial/milbeaut_usio.c ++++ b/drivers/tty/serial/milbeaut_usio.c +@@ -207,9 +207,9 @@ static irqreturn_t mlb_usio_rx_irq(int irq, void *dev_id) + { + struct uart_port *port = dev_id; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + mlb_usio_rx_chars(port); +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -218,10 +218,10 @@ static irqreturn_t mlb_usio_tx_irq(int irq, void *dev_id) + { + struct uart_port *port = dev_id; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + if (readb(port->membase + MLB_USIO_REG_SSR) & MLB_USIO_SSR_TBI) + mlb_usio_tx_chars(port); +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -267,7 +267,7 @@ static int mlb_usio_startup(struct uart_port *port) + escr = readb(port->membase + MLB_USIO_REG_ESCR); + if (of_property_read_bool(port->dev->of_node, "auto-flow-control")) + escr |= MLB_USIO_ESCR_FLWEN; +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + writeb(0, port->membase + MLB_USIO_REG_SCR); + writeb(escr, port->membase + MLB_USIO_REG_ESCR); + writeb(MLB_USIO_SCR_UPCL, port->membase + MLB_USIO_REG_SCR); +@@ -282,7 +282,7 @@ static int mlb_usio_startup(struct uart_port *port) + + writeb(MLB_USIO_SCR_TXE | MLB_USIO_SCR_RIE | MLB_USIO_SCR_TBIE | + MLB_USIO_SCR_RXE, port->membase + MLB_USIO_REG_SCR); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return 0; + } +@@ -337,7 +337,7 @@ static void mlb_usio_set_termios(struct uart_port *port, + else + quot = 0; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + uart_update_timeout(port, termios->c_cflag, baud); + port->read_status_mask = MLB_USIO_SSR_ORE | MLB_USIO_SSR_RDRF | + MLB_USIO_SSR_TDRE; +@@ -367,7 +367,7 @@ static void mlb_usio_set_termios(struct uart_port *port, + writew(BIT(12), port->membase + MLB_USIO_REG_FBYTE); + writeb(MLB_USIO_SCR_RIE | MLB_USIO_SCR_RXE | MLB_USIO_SCR_TBIE | + MLB_USIO_SCR_TXE, port->membase + MLB_USIO_REG_SCR); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *mlb_usio_type(struct uart_port *port) +diff --git a/drivers/tty/serial/mpc52xx_uart.c b/drivers/tty/serial/mpc52xx_uart.c +index 916507b8f..a252465e7 100644 +--- a/drivers/tty/serial/mpc52xx_uart.c ++++ b/drivers/tty/serial/mpc52xx_uart.c +@@ -1096,14 +1096,14 @@ static void + mpc52xx_uart_break_ctl(struct uart_port *port, int ctl) + { + unsigned long flags; +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + if (ctl == -1) + psc_ops->command(port, MPC52xx_PSC_START_BRK); + else + psc_ops->command(port, MPC52xx_PSC_STOP_BRK); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int +@@ -1214,7 +1214,7 @@ mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new, + } + + /* Get the lock */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Do our best to flush TX & RX, so we don't lose anything */ + /* But we don't wait indefinitely ! */ +@@ -1250,7 +1250,7 @@ mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new, + psc_ops->command(port, MPC52xx_PSC_RX_ENABLE); + + /* We're all set, release the lock */ +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char * +@@ -1477,11 +1477,11 @@ mpc52xx_uart_int(int irq, void *dev_id) + struct uart_port *port = dev_id; + irqreturn_t ret; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + ret = psc_ops->handle_irq(port); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return ret; + } +diff --git a/drivers/tty/serial/mps2-uart.c b/drivers/tty/serial/mps2-uart.c +index ea5a7911c..2a4c09f3a 100644 +--- a/drivers/tty/serial/mps2-uart.c ++++ b/drivers/tty/serial/mps2-uart.c +@@ -188,12 +188,12 @@ static irqreturn_t mps2_uart_rxirq(int irq, void *data) + if (unlikely(!(irqflag & UARTn_INT_RX))) + return IRQ_NONE; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + mps2_uart_write8(port, UARTn_INT_RX, UARTn_INT); + mps2_uart_rx_chars(port); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -206,12 +206,12 @@ static irqreturn_t mps2_uart_txirq(int irq, void *data) + if (unlikely(!(irqflag & UARTn_INT_TX))) + return IRQ_NONE; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + mps2_uart_write8(port, UARTn_INT_TX, UARTn_INT); + mps2_uart_tx_chars(port); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -222,7 +222,7 @@ static irqreturn_t mps2_uart_oerrirq(int irq, void *data) + struct uart_port *port = data; + u8 irqflag = mps2_uart_read8(port, UARTn_INT); + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + if (irqflag & UARTn_INT_RX_OVERRUN) { + struct tty_port *tport = &port->state->port; +@@ -244,7 +244,7 @@ static irqreturn_t mps2_uart_oerrirq(int irq, void *data) + handled = IRQ_HANDLED; + } + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return handled; + } +@@ -356,12 +356,12 @@ mps2_uart_set_termios(struct uart_port *port, struct ktermios *termios, + + bauddiv = DIV_ROUND_CLOSEST(port->uartclk, baud); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + uart_update_timeout(port, termios->c_cflag, baud); + mps2_uart_write32(port, bauddiv, UARTn_BAUDDIV); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (tty_termios_baud_rate(termios)) + tty_termios_encode_baud_rate(termios, baud, baud); +diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c +index 90953e679..597264b54 100644 +--- a/drivers/tty/serial/msm_serial.c ++++ b/drivers/tty/serial/msm_serial.c +@@ -444,7 +444,7 @@ static void msm_complete_tx_dma(void *args) + unsigned int count; + u32 val; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Already stopped */ + if (!dma->count) +@@ -476,7 +476,7 @@ static void msm_complete_tx_dma(void *args) + + msm_handle_tx(port); + done: +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int msm_handle_tx_dma(struct msm_port *msm_port, unsigned int count) +@@ -549,7 +549,7 @@ static void msm_complete_rx_dma(void *args) + unsigned long flags; + u32 val; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Already stopped */ + if (!dma->count) +@@ -587,16 +587,16 @@ static void msm_complete_rx_dma(void *args) + if (!(port->read_status_mask & MSM_UART_SR_RX_BREAK)) + flag = TTY_NORMAL; + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + sysrq = uart_handle_sysrq_char(port, dma->virt[i]); +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (!sysrq) + tty_insert_flip_char(tport, dma->virt[i], flag); + } + + msm_start_rx_dma(msm_port); + done: +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (count) + tty_flip_buffer_push(tport); +@@ -762,9 +762,9 @@ static void msm_handle_rx_dm(struct uart_port *port, unsigned int misr) + if (!(port->read_status_mask & MSM_UART_SR_RX_BREAK)) + flag = TTY_NORMAL; + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + sysrq = uart_handle_sysrq_char(port, buf[i]); +- spin_lock(&port->lock); ++ uart_port_lock(port); + if (!sysrq) + tty_insert_flip_char(tport, buf[i], flag); + } +@@ -824,9 +824,9 @@ static void msm_handle_rx(struct uart_port *port) + else if (sr & MSM_UART_SR_PAR_FRAME_ERR) + flag = TTY_FRAME; + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + sysrq = uart_handle_sysrq_char(port, c); +- spin_lock(&port->lock); ++ uart_port_lock(port); + if (!sysrq) + tty_insert_flip_char(tport, c, flag); + } +@@ -951,7 +951,7 @@ static irqreturn_t msm_uart_irq(int irq, void *dev_id) + unsigned int misr; + u32 val; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + misr = msm_read(port, MSM_UART_MISR); + msm_write(port, 0, MSM_UART_IMR); /* disable interrupt */ + +@@ -983,7 +983,7 @@ static irqreturn_t msm_uart_irq(int irq, void *dev_id) + msm_handle_delta_cts(port); + + msm_write(port, msm_port->imr, MSM_UART_IMR); /* restore interrupt */ +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return IRQ_HANDLED; + } +@@ -1128,13 +1128,13 @@ static int msm_set_baud_rate(struct uart_port *port, unsigned int baud, + unsigned long flags, rate; + + flags = *saved_flags; +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + entry = msm_find_best_baud(port, baud, &rate); + clk_set_rate(msm_port->clk, rate); + baud = rate / 16 / entry->divisor; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + *saved_flags = flags; + port->uartclk = rate; + +@@ -1266,7 +1266,7 @@ static void msm_set_termios(struct uart_port *port, struct ktermios *termios, + unsigned long flags; + unsigned int baud, mr; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + if (dma->chan) /* Terminate if any */ + msm_stop_dma(port, dma); +@@ -1338,7 +1338,7 @@ static void msm_set_termios(struct uart_port *port, struct ktermios *termios, + /* Try to use DMA */ + msm_start_rx_dma(msm_port); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *msm_type(struct uart_port *port) +@@ -1620,9 +1620,9 @@ static void __msm_console_write(struct uart_port *port, const char *s, + if (port->sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock(&port->lock); ++ locked = uart_port_trylock(port); + else +- spin_lock(&port->lock); ++ uart_port_lock(port); + + if (is_uartdm) + msm_reset_dm_count(port, count); +@@ -1661,7 +1661,7 @@ static void __msm_console_write(struct uart_port *port, const char *s, + } + + if (locked) +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + local_irq_restore(flags); + } +diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c +index ea924e9b9..0255646bc 100644 +--- a/drivers/tty/serial/mvebu-uart.c ++++ b/drivers/tty/serial/mvebu-uart.c +@@ -187,9 +187,9 @@ static unsigned int mvebu_uart_tx_empty(struct uart_port *port) + unsigned long flags; + unsigned int st; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + st = readl(port->membase + UART_STAT); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return (st & STAT_TX_EMP) ? TIOCSER_TEMT : 0; + } +@@ -249,14 +249,14 @@ static void mvebu_uart_break_ctl(struct uart_port *port, int brk) + unsigned int ctl; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + ctl = readl(port->membase + UART_CTRL(port)); + if (brk == -1) + ctl |= CTRL_SND_BRK_SEQ; + else + ctl &= ~CTRL_SND_BRK_SEQ; + writel(ctl, port->membase + UART_CTRL(port)); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void mvebu_uart_rx_chars(struct uart_port *port, unsigned int status) +@@ -540,7 +540,7 @@ static void mvebu_uart_set_termios(struct uart_port *port, + unsigned long flags; + unsigned int baud, min_baud, max_baud; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + port->read_status_mask = STAT_RX_RDY(port) | STAT_OVR_ERR | + STAT_TX_RDY(port) | STAT_TX_FIFO_FUL; +@@ -589,7 +589,7 @@ static void mvebu_uart_set_termios(struct uart_port *port, + uart_update_timeout(port, termios->c_cflag, baud); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *mvebu_uart_type(struct uart_port *port) +@@ -735,9 +735,9 @@ static void mvebu_uart_console_write(struct console *co, const char *s, + int locked = 1; + + if (oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + ier = readl(port->membase + UART_CTRL(port)) & CTRL_BRK_INT; + intr = readl(port->membase + UART_INTR(port)) & +@@ -758,7 +758,7 @@ static void mvebu_uart_console_write(struct console *co, const char *s, + } + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int mvebu_uart_console_setup(struct console *co, char *options) +diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c +index 135a838f5..1097fca22 100644 +--- a/drivers/tty/serial/omap-serial.c ++++ b/drivers/tty/serial/omap-serial.c +@@ -390,10 +390,10 @@ static void serial_omap_throttle(struct uart_port *port) + struct uart_omap_port *up = to_uart_omap_port(port); + unsigned long flags; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + up->ier &= ~(UART_IER_RLSI | UART_IER_RDI); + serial_out(up, UART_IER, up->ier); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static void serial_omap_unthrottle(struct uart_port *port) +@@ -401,10 +401,10 @@ static void serial_omap_unthrottle(struct uart_port *port) + struct uart_omap_port *up = to_uart_omap_port(port); + unsigned long flags; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + up->ier |= UART_IER_RLSI | UART_IER_RDI; + serial_out(up, UART_IER, up->ier); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static unsigned int check_modem_status(struct uart_omap_port *up) +@@ -527,7 +527,7 @@ static irqreturn_t serial_omap_irq(int irq, void *dev_id) + irqreturn_t ret = IRQ_NONE; + int max_count = 256; + +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + + do { + iir = serial_in(up, UART_IIR); +@@ -563,7 +563,7 @@ static irqreturn_t serial_omap_irq(int irq, void *dev_id) + } + } while (max_count--); + +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + + tty_flip_buffer_push(&up->port.state->port); + +@@ -579,9 +579,9 @@ static unsigned int serial_omap_tx_empty(struct uart_port *port) + unsigned int ret = 0; + + dev_dbg(up->port.dev, "serial_omap_tx_empty+%d\n", up->port.line); +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0; +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + return ret; + } +@@ -647,13 +647,13 @@ static void serial_omap_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + + dev_dbg(up->port.dev, "serial_omap_break_ctl+%d\n", up->port.line); +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + if (break_state == -1) + up->lcr |= UART_LCR_SBC; + else + up->lcr &= ~UART_LCR_SBC; + serial_out(up, UART_LCR, up->lcr); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static int serial_omap_startup(struct uart_port *port) +@@ -701,13 +701,13 @@ static int serial_omap_startup(struct uart_port *port) + * Now, initialize the UART + */ + serial_out(up, UART_LCR, UART_LCR_WLEN8); +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + /* + * Most PC uarts need OUT2 raised to enable interrupts. + */ + up->port.mctrl |= TIOCM_OUT2; + serial_omap_set_mctrl(&up->port, up->port.mctrl); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + up->msr_saved_flags = 0; + /* +@@ -742,10 +742,10 @@ static void serial_omap_shutdown(struct uart_port *port) + up->ier = 0; + serial_out(up, UART_IER, 0); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + up->port.mctrl &= ~TIOCM_OUT2; + serial_omap_set_mctrl(&up->port, up->port.mctrl); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + /* + * Disable break condition and FIFOs +@@ -815,7 +815,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, + * Ok, we're now changing the port state. Do it with + * interrupts disabled. + */ +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* + * Update the per-port timeout. +@@ -1013,7 +1013,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, + + serial_omap_set_mctrl(&up->port, up->port.mctrl); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->port.line); + } + +@@ -1212,13 +1212,10 @@ serial_omap_console_write(struct console *co, const char *s, + unsigned int ier; + int locked = 1; + +- local_irq_save(flags); +- if (up->port.sysrq) +- locked = 0; +- else if (oops_in_progress) +- locked = spin_trylock(&up->port.lock); ++ if (up->port.sysrq || oops_in_progress) ++ locked = uart_port_trylock_irqsave(&up->port, &flags); + else +- spin_lock(&up->port.lock); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* + * First save the IER then disable the interrupts +@@ -1245,8 +1242,7 @@ serial_omap_console_write(struct console *co, const char *s, + check_modem_status(up); + + if (locked) +- spin_unlock(&up->port.lock); +- local_irq_restore(flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static int __init +diff --git a/drivers/tty/serial/owl-uart.c b/drivers/tty/serial/owl-uart.c +index e99970a94..919f5e5aa 100644 +--- a/drivers/tty/serial/owl-uart.c ++++ b/drivers/tty/serial/owl-uart.c +@@ -125,12 +125,12 @@ static unsigned int owl_uart_tx_empty(struct uart_port *port) + u32 val; + unsigned int ret; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + val = owl_uart_read(port, OWL_UART_STAT); + ret = (val & OWL_UART_STAT_TFES) ? TIOCSER_TEMT : 0; + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return ret; + } +@@ -232,7 +232,7 @@ static irqreturn_t owl_uart_irq(int irq, void *dev_id) + unsigned long flags; + u32 stat; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + stat = owl_uart_read(port, OWL_UART_STAT); + +@@ -246,7 +246,7 @@ static irqreturn_t owl_uart_irq(int irq, void *dev_id) + stat |= OWL_UART_STAT_RIP | OWL_UART_STAT_TIP; + owl_uart_write(port, stat, OWL_UART_STAT); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return IRQ_HANDLED; + } +@@ -256,14 +256,14 @@ static void owl_uart_shutdown(struct uart_port *port) + u32 val; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + val = owl_uart_read(port, OWL_UART_CTL); + val &= ~(OWL_UART_CTL_TXIE | OWL_UART_CTL_RXIE + | OWL_UART_CTL_TXDE | OWL_UART_CTL_RXDE | OWL_UART_CTL_EN); + owl_uart_write(port, val, OWL_UART_CTL); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + free_irq(port->irq, port); + } +@@ -279,7 +279,7 @@ static int owl_uart_startup(struct uart_port *port) + if (ret) + return ret; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + val = owl_uart_read(port, OWL_UART_STAT); + val |= OWL_UART_STAT_RIP | OWL_UART_STAT_TIP +@@ -291,7 +291,7 @@ static int owl_uart_startup(struct uart_port *port) + val |= OWL_UART_CTL_EN; + owl_uart_write(port, val, OWL_UART_CTL); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return 0; + } +@@ -311,7 +311,7 @@ static void owl_uart_set_termios(struct uart_port *port, + u32 ctl; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + ctl = owl_uart_read(port, OWL_UART_CTL); + +@@ -371,7 +371,7 @@ static void owl_uart_set_termios(struct uart_port *port, + + uart_update_timeout(port, termios->c_cflag, baud); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void owl_uart_release_port(struct uart_port *port) +@@ -515,9 +515,9 @@ static void owl_uart_port_write(struct uart_port *port, const char *s, + if (port->sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock(&port->lock); ++ locked = uart_port_trylock(port); + else { +- spin_lock(&port->lock); ++ uart_port_lock(port); + locked = 1; + } + +@@ -541,7 +541,7 @@ static void owl_uart_port_write(struct uart_port *port, const char *s, + owl_uart_write(port, old_ctl, OWL_UART_CTL); + + if (locked) +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + local_irq_restore(flags); + } +diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c +index cc83b772b..436cc6d52 100644 +--- a/drivers/tty/serial/pch_uart.c ++++ b/drivers/tty/serial/pch_uart.c +@@ -1347,7 +1347,7 @@ static void pch_uart_set_termios(struct uart_port *port, + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); + + spin_lock_irqsave(&priv->lock, flags); +- spin_lock(&port->lock); ++ uart_port_lock(port); + + uart_update_timeout(port, termios->c_cflag, baud); + rtn = pch_uart_hal_set_line(priv, baud, parity, bits, stb); +@@ -1360,7 +1360,7 @@ static void pch_uart_set_termios(struct uart_port *port, + tty_termios_encode_baud_rate(termios, baud, baud); + + out: +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + spin_unlock_irqrestore(&priv->lock, flags); + } + +@@ -1581,10 +1581,10 @@ pch_console_write(struct console *co, const char *s, unsigned int count) + port_locked = 0; + } else if (oops_in_progress) { + priv_locked = spin_trylock(&priv->lock); +- port_locked = spin_trylock(&priv->port.lock); ++ port_locked = uart_port_trylock(&priv->port); + } else { + spin_lock(&priv->lock); +- spin_lock(&priv->port.lock); ++ uart_port_lock(&priv->port); + } + + /* +@@ -1604,7 +1604,7 @@ pch_console_write(struct console *co, const char *s, unsigned int count) + iowrite8(ier, priv->membase + UART_IER); + + if (port_locked) +- spin_unlock(&priv->port.lock); ++ uart_port_unlock(&priv->port); + if (priv_locked) + spin_unlock(&priv->lock); + local_irq_restore(flags); +diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uart.c +index e308d5022..3a95bf5d5 100644 +--- a/drivers/tty/serial/pic32_uart.c ++++ b/drivers/tty/serial/pic32_uart.c +@@ -243,7 +243,7 @@ static void pic32_uart_break_ctl(struct uart_port *port, int ctl) + struct pic32_sport *sport = to_pic32_sport(port); + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + if (ctl) + pic32_uart_writel(sport, PIC32_SET(PIC32_UART_STA), +@@ -252,7 +252,7 @@ static void pic32_uart_break_ctl(struct uart_port *port, int ctl) + pic32_uart_writel(sport, PIC32_CLR(PIC32_UART_STA), + PIC32_UART_STA_UTXBRK); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* get port type in string format */ +@@ -274,7 +274,7 @@ static void pic32_uart_do_rx(struct uart_port *port) + */ + max_count = PIC32_UART_RX_FIFO_DEPTH; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + tty = &port->state->port; + +@@ -331,7 +331,7 @@ static void pic32_uart_do_rx(struct uart_port *port) + + } while (--max_count); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + tty_flip_buffer_push(tty); + } +@@ -410,9 +410,9 @@ static irqreturn_t pic32_uart_tx_interrupt(int irq, void *dev_id) + struct uart_port *port = dev_id; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + pic32_uart_do_tx(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return IRQ_HANDLED; + } +@@ -580,9 +580,9 @@ static void pic32_uart_shutdown(struct uart_port *port) + unsigned long flags; + + /* disable uart */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + pic32_uart_dsbl_and_mask(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + clk_disable_unprepare(sport->clk); + + /* free all 3 interrupts for this UART */ +@@ -604,7 +604,7 @@ static void pic32_uart_set_termios(struct uart_port *port, + unsigned int quot; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* disable uart and mask all interrupts while changing speed */ + pic32_uart_dsbl_and_mask(port); +@@ -672,7 +672,7 @@ static void pic32_uart_set_termios(struct uart_port *port, + /* enable uart */ + pic32_uart_en_and_unmask(port); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* serial core request to claim uart iomem */ +diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c +index 29bc80d39..77691fbbf 100644 +--- a/drivers/tty/serial/pmac_zilog.c ++++ b/drivers/tty/serial/pmac_zilog.c +@@ -245,9 +245,9 @@ static bool pmz_receive_chars(struct uart_pmac_port *uap) + #endif /* USE_CTRL_O_SYSRQ */ + if (uap->port.sysrq) { + int swallow; +- spin_unlock(&uap->port.lock); ++ uart_port_unlock(&uap->port); + swallow = uart_handle_sysrq_char(&uap->port, ch); +- spin_lock(&uap->port.lock); ++ uart_port_lock(&uap->port); + if (swallow) + goto next_char; + } +@@ -421,7 +421,7 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) + uap_a = pmz_get_port_A(uap); + uap_b = uap_a->mate; + +- spin_lock(&uap_a->port.lock); ++ uart_port_lock(&uap_a->port); + r3 = read_zsreg(uap_a, R3); + + /* Channel A */ +@@ -442,14 +442,14 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) + rc = IRQ_HANDLED; + } + skip_a: +- spin_unlock(&uap_a->port.lock); ++ uart_port_unlock(&uap_a->port); + if (push) + tty_flip_buffer_push(&uap->port.state->port); + + if (!uap_b) + goto out; + +- spin_lock(&uap_b->port.lock); ++ uart_port_lock(&uap_b->port); + push = false; + if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) { + if (!ZS_IS_OPEN(uap_b)) { +@@ -467,7 +467,7 @@ static irqreturn_t pmz_interrupt(int irq, void *dev_id) + rc = IRQ_HANDLED; + } + skip_b: +- spin_unlock(&uap_b->port.lock); ++ uart_port_unlock(&uap_b->port); + if (push) + tty_flip_buffer_push(&uap->port.state->port); + +@@ -483,9 +483,9 @@ static inline u8 pmz_peek_status(struct uart_pmac_port *uap) + unsigned long flags; + u8 status; + +- spin_lock_irqsave(&uap->port.lock, flags); ++ uart_port_lock_irqsave(&uap->port, &flags); + status = read_zsreg(uap, R0); +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + + return status; + } +@@ -671,7 +671,7 @@ static void pmz_break_ctl(struct uart_port *port, int break_state) + else + clear_bits |= SND_BRK; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + new_reg = (uap->curregs[R5] | set_bits) & ~clear_bits; + if (new_reg != uap->curregs[R5]) { +@@ -679,7 +679,7 @@ static void pmz_break_ctl(struct uart_port *port, int break_state) + write_zsreg(uap, R5, uap->curregs[R5]); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + #ifdef CONFIG_PPC_PMAC +@@ -851,18 +851,18 @@ static void pmz_irda_reset(struct uart_pmac_port *uap) + { + unsigned long flags; + +- spin_lock_irqsave(&uap->port.lock, flags); ++ uart_port_lock_irqsave(&uap->port, &flags); + uap->curregs[R5] |= DTR; + write_zsreg(uap, R5, uap->curregs[R5]); + zssync(uap); +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + msleep(110); + +- spin_lock_irqsave(&uap->port.lock, flags); ++ uart_port_lock_irqsave(&uap->port, &flags); + uap->curregs[R5] &= ~DTR; + write_zsreg(uap, R5, uap->curregs[R5]); + zssync(uap); +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + msleep(10); + } + +@@ -882,9 +882,9 @@ static int pmz_startup(struct uart_port *port) + * initialize the chip + */ + if (!ZS_IS_CONS(uap)) { +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + pwr_delay = __pmz_startup(uap); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + sprintf(uap->irq_name, PMACZILOG_NAME"%d", uap->port.line); + if (request_irq(uap->port.irq, pmz_interrupt, IRQF_SHARED, +@@ -907,9 +907,9 @@ static int pmz_startup(struct uart_port *port) + pmz_irda_reset(uap); + + /* Enable interrupt requests for the channel */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + pmz_interrupt_control(uap, 1); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return 0; + } +@@ -919,7 +919,7 @@ static void pmz_shutdown(struct uart_port *port) + struct uart_pmac_port *uap = to_pmz(port); + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Disable interrupt requests for the channel */ + pmz_interrupt_control(uap, 0); +@@ -934,19 +934,19 @@ static void pmz_shutdown(struct uart_port *port) + pmz_maybe_update_regs(uap); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* Release interrupt handler */ + free_irq(uap->port.irq, uap); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + uap->flags &= ~PMACZILOG_FLAG_IS_OPEN; + + if (!ZS_IS_CONS(uap)) + pmz_set_scc_power(uap, 0); /* Shut the chip down */ + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* Shared by TTY driver and serial console setup. The port lock is held +@@ -1233,7 +1233,7 @@ static void pmz_set_termios(struct uart_port *port, struct ktermios *termios, + struct uart_pmac_port *uap = to_pmz(port); + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Disable IRQs on the port */ + pmz_interrupt_control(uap, 0); +@@ -1245,7 +1245,7 @@ static void pmz_set_termios(struct uart_port *port, struct ktermios *termios, + if (ZS_IS_OPEN(uap)) + pmz_interrupt_control(uap, 1); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *pmz_type(struct uart_port *port) +@@ -1882,7 +1882,7 @@ static void pmz_console_write(struct console *con, const char *s, unsigned int c + struct uart_pmac_port *uap = &pmz_ports[con->index]; + unsigned long flags; + +- spin_lock_irqsave(&uap->port.lock, flags); ++ uart_port_lock_irqsave(&uap->port, &flags); + + /* Turn of interrupts and enable the transmitter. */ + write_zsreg(uap, R1, uap->curregs[1] & ~TxINT_ENAB); +@@ -1894,7 +1894,7 @@ static void pmz_console_write(struct console *con, const char *s, unsigned int c + write_zsreg(uap, R1, uap->curregs[1]); + /* Don't disable the transmitter. */ + +- spin_unlock_irqrestore(&uap->port.lock, flags); ++ uart_port_unlock_irqrestore(&uap->port, flags); + } + + /* +diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c +index 73c60f5ea..46e70e155 100644 +--- a/drivers/tty/serial/pxa.c ++++ b/drivers/tty/serial/pxa.c +@@ -225,14 +225,14 @@ static inline irqreturn_t serial_pxa_irq(int irq, void *dev_id) + iir = serial_in(up, UART_IIR); + if (iir & UART_IIR_NO_INT) + return IRQ_NONE; +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + lsr = serial_in(up, UART_LSR); + if (lsr & UART_LSR_DR) + receive_chars(up, &lsr); + check_modem_status(up); + if (lsr & UART_LSR_THRE) + transmit_chars(up); +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + return IRQ_HANDLED; + } + +@@ -242,9 +242,9 @@ static unsigned int serial_pxa_tx_empty(struct uart_port *port) + unsigned long flags; + unsigned int ret; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0; +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + return ret; + } +@@ -295,13 +295,13 @@ static void serial_pxa_break_ctl(struct uart_port *port, int break_state) + struct uart_pxa_port *up = (struct uart_pxa_port *)port; + unsigned long flags; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + if (break_state == -1) + up->lcr |= UART_LCR_SBC; + else + up->lcr &= ~UART_LCR_SBC; + serial_out(up, UART_LCR, up->lcr); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static int serial_pxa_startup(struct uart_port *port) +@@ -346,10 +346,10 @@ static int serial_pxa_startup(struct uart_port *port) + */ + serial_out(up, UART_LCR, UART_LCR_WLEN8); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + up->port.mctrl |= TIOCM_OUT2; + serial_pxa_set_mctrl(&up->port, up->port.mctrl); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + /* + * Finally, enable interrupts. Note: Modem status interrupts +@@ -383,10 +383,10 @@ static void serial_pxa_shutdown(struct uart_port *port) + up->ier = 0; + serial_out(up, UART_IER, 0); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + up->port.mctrl &= ~TIOCM_OUT2; + serial_pxa_set_mctrl(&up->port, up->port.mctrl); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + /* + * Disable break condition and FIFOs +@@ -434,7 +434,7 @@ serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios, + * Ok, we're now changing the port state. Do it with + * interrupts disabled. + */ +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* + * Ensure the port will be enabled. +@@ -504,7 +504,7 @@ serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios, + up->lcr = cval; /* Save LCR */ + serial_pxa_set_mctrl(&up->port, up->port.mctrl); + serial_out(up, UART_FCR, fcr); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static void +@@ -608,9 +608,9 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count) + if (up->port.sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock(&up->port.lock); ++ locked = uart_port_trylock(&up->port); + else +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + + /* + * First save the IER then disable the interrupts +@@ -628,7 +628,7 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count) + serial_out(up, UART_IER, ier); + + if (locked) +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + local_irq_restore(flags); + clk_disable(up->clk); + +diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c +index 2e1b1c827..549909644 100644 +--- a/drivers/tty/serial/qcom_geni_serial.c ++++ b/drivers/tty/serial/qcom_geni_serial.c +@@ -482,9 +482,9 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, + + uport = &port->uport; + if (oops_in_progress) +- locked = spin_trylock_irqsave(&uport->lock, flags); ++ locked = uart_port_trylock_irqsave(uport, &flags); + else +- spin_lock_irqsave(&uport->lock, flags); ++ uart_port_lock_irqsave(uport, &flags); + + geni_status = readl(uport->membase + SE_GENI_STATUS); + +@@ -520,7 +520,7 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, + qcom_geni_serial_setup_tx(uport, port->tx_remaining); + + if (locked) +- spin_unlock_irqrestore(&uport->lock, flags); ++ uart_port_unlock_irqrestore(uport, flags); + } + + static void handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) +@@ -972,7 +972,7 @@ static irqreturn_t qcom_geni_serial_isr(int isr, void *dev) + if (uport->suspended) + return IRQ_NONE; + +- spin_lock(&uport->lock); ++ uart_port_lock(uport); + + m_irq_status = readl(uport->membase + SE_GENI_M_IRQ_STATUS); + s_irq_status = readl(uport->membase + SE_GENI_S_IRQ_STATUS); +diff --git a/drivers/tty/serial/rda-uart.c b/drivers/tty/serial/rda-uart.c +index be5c842b5..d824c8318 100644 +--- a/drivers/tty/serial/rda-uart.c ++++ b/drivers/tty/serial/rda-uart.c +@@ -139,12 +139,12 @@ static unsigned int rda_uart_tx_empty(struct uart_port *port) + unsigned int ret; + u32 val; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + val = rda_uart_read(port, RDA_UART_STATUS); + ret = (val & RDA_UART_TX_FIFO_MASK) ? TIOCSER_TEMT : 0; + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return ret; + } +@@ -246,7 +246,7 @@ static void rda_uart_set_termios(struct uart_port *port, + unsigned int baud; + u32 irq_mask; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + baud = uart_get_baud_rate(port, termios, old, 9600, port->uartclk / 4); + rda_uart_change_baudrate(rda_port, baud); +@@ -325,7 +325,7 @@ static void rda_uart_set_termios(struct uart_port *port, + /* update the per-port timeout */ + uart_update_timeout(port, termios->c_cflag, baud); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void rda_uart_send_chars(struct uart_port *port) +@@ -408,7 +408,7 @@ static irqreturn_t rda_interrupt(int irq, void *dev_id) + unsigned long flags; + u32 val, irq_mask; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Clear IRQ cause */ + val = rda_uart_read(port, RDA_UART_IRQ_CAUSE); +@@ -425,7 +425,7 @@ static irqreturn_t rda_interrupt(int irq, void *dev_id) + rda_uart_send_chars(port); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return IRQ_HANDLED; + } +@@ -436,16 +436,16 @@ static int rda_uart_startup(struct uart_port *port) + int ret; + u32 val; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + rda_uart_write(port, 0, RDA_UART_IRQ_MASK); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + ret = request_irq(port->irq, rda_interrupt, IRQF_NO_SUSPEND, + "rda-uart", port); + if (ret) + return ret; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + val = rda_uart_read(port, RDA_UART_CTRL); + val |= RDA_UART_ENABLE; +@@ -456,7 +456,7 @@ static int rda_uart_startup(struct uart_port *port) + val |= (RDA_UART_RX_DATA_AVAILABLE | RDA_UART_RX_TIMEOUT); + rda_uart_write(port, val, RDA_UART_IRQ_MASK); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return 0; + } +@@ -466,7 +466,7 @@ static void rda_uart_shutdown(struct uart_port *port) + unsigned long flags; + u32 val; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + rda_uart_stop_tx(port); + rda_uart_stop_rx(port); +@@ -475,7 +475,7 @@ static void rda_uart_shutdown(struct uart_port *port) + val &= ~RDA_UART_ENABLE; + rda_uart_write(port, val, RDA_UART_CTRL); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *rda_uart_type(struct uart_port *port) +@@ -515,7 +515,7 @@ static void rda_uart_config_port(struct uart_port *port, int flags) + rda_uart_request_port(port); + } + +- spin_lock_irqsave(&port->lock, irq_flags); ++ uart_port_lock_irqsave(port, &irq_flags); + + /* Clear mask, so no surprise interrupts. */ + rda_uart_write(port, 0, RDA_UART_IRQ_MASK); +@@ -523,7 +523,7 @@ static void rda_uart_config_port(struct uart_port *port, int flags) + /* Clear status register */ + rda_uart_write(port, 0, RDA_UART_STATUS); + +- spin_unlock_irqrestore(&port->lock, irq_flags); ++ uart_port_unlock_irqrestore(port, irq_flags); + } + + static void rda_uart_release_port(struct uart_port *port) +@@ -597,9 +597,9 @@ static void rda_uart_port_write(struct uart_port *port, const char *s, + if (port->sysrq) { + locked = 0; + } else if (oops_in_progress) { +- locked = spin_trylock(&port->lock); ++ locked = uart_port_trylock(port); + } else { +- spin_lock(&port->lock); ++ uart_port_lock(port); + locked = 1; + } + +@@ -615,7 +615,7 @@ static void rda_uart_port_write(struct uart_port *port, const char *s, + rda_uart_write(port, old_irq_mask, RDA_UART_IRQ_MASK); + + if (locked) +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + local_irq_restore(flags); + } +diff --git a/drivers/tty/serial/rp2.c b/drivers/tty/serial/rp2.c +index de220ac8c..d46a81cdd 100644 +--- a/drivers/tty/serial/rp2.c ++++ b/drivers/tty/serial/rp2.c +@@ -276,9 +276,9 @@ static unsigned int rp2_uart_tx_empty(struct uart_port *port) + * But the TXEMPTY bit doesn't seem to work unless the TX IRQ is + * enabled. + */ +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + tx_fifo_bytes = readw(up->base + RP2_TX_FIFO_COUNT); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + return tx_fifo_bytes ? 0 : TIOCSER_TEMT; + } +@@ -323,10 +323,10 @@ static void rp2_uart_break_ctl(struct uart_port *port, int break_state) + { + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + rp2_rmw(port_to_up(port), RP2_TXRX_CTL, RP2_TXRX_CTL_BREAK_m, + break_state ? RP2_TXRX_CTL_BREAK_m : 0); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void rp2_uart_enable_ms(struct uart_port *port) +@@ -383,7 +383,7 @@ static void rp2_uart_set_termios(struct uart_port *port, struct ktermios *new, + if (tty_termios_baud_rate(new)) + tty_termios_encode_baud_rate(new, baud, baud); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* ignore all characters if CREAD is not set */ + port->ignore_status_mask = (new->c_cflag & CREAD) ? 0 : RP2_DUMMY_READ; +@@ -391,7 +391,7 @@ static void rp2_uart_set_termios(struct uart_port *port, struct ktermios *new, + __rp2_uart_set_termios(up, new->c_cflag, new->c_iflag, baud_div); + uart_update_timeout(port, new->c_cflag, baud); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void rp2_rx_chars(struct rp2_uart_port *up) +@@ -440,7 +440,7 @@ static void rp2_ch_interrupt(struct rp2_uart_port *up) + { + u32 status; + +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + + /* + * The IRQ status bits are clear-on-write. Other status bits in +@@ -456,7 +456,7 @@ static void rp2_ch_interrupt(struct rp2_uart_port *up) + if (status & RP2_CHAN_STAT_MS_CHANGED_MASK) + wake_up_interruptible(&up->port.state->port.delta_msr_wait); + +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + } + + static int rp2_asic_interrupt(struct rp2_card *card, unsigned int asic_id) +@@ -516,10 +516,10 @@ static void rp2_uart_shutdown(struct uart_port *port) + + rp2_uart_break_ctl(port, 0); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + rp2_mask_ch_irq(up, up->idx, 0); + rp2_rmw(up, RP2_CHAN_STAT, 0, 0); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *rp2_uart_type(struct uart_port *port) +diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c +index ad011f1e2..be7bcd75d 100644 +--- a/drivers/tty/serial/sa1100.c ++++ b/drivers/tty/serial/sa1100.c +@@ -115,9 +115,9 @@ static void sa1100_timeout(struct timer_list *t) + unsigned long flags; + + if (sport->port.state) { +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + sa1100_mctrl_check(sport); +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + + mod_timer(&sport->timer, jiffies + MCTRL_TIMEOUT); + } +@@ -247,7 +247,7 @@ static irqreturn_t sa1100_int(int irq, void *dev_id) + struct sa1100_port *sport = dev_id; + unsigned int status, pass_counter = 0; + +- spin_lock(&sport->port.lock); ++ uart_port_lock(&sport->port); + status = UART_GET_UTSR0(sport); + status &= SM_TO_UTSR0(sport->port.read_status_mask) | ~UTSR0_TFS; + do { +@@ -276,7 +276,7 @@ static irqreturn_t sa1100_int(int irq, void *dev_id) + status &= SM_TO_UTSR0(sport->port.read_status_mask) | + ~UTSR0_TFS; + } while (status & (UTSR0_TFS | UTSR0_RFS | UTSR0_RID)); +- spin_unlock(&sport->port.lock); ++ uart_port_unlock(&sport->port); + + return IRQ_HANDLED; + } +@@ -321,14 +321,14 @@ static void sa1100_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + unsigned int utcr3; + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + utcr3 = UART_GET_UTCR3(sport); + if (break_state == -1) + utcr3 |= UTCR3_BRK; + else + utcr3 &= ~UTCR3_BRK; + UART_PUT_UTCR3(sport, utcr3); +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static int sa1100_startup(struct uart_port *port) +@@ -354,9 +354,9 @@ static int sa1100_startup(struct uart_port *port) + /* + * Enable modem status interrupts + */ +- spin_lock_irq(&sport->port.lock); ++ uart_port_lock_irq(&sport->port); + sa1100_enable_ms(&sport->port); +- spin_unlock_irq(&sport->port.lock); ++ uart_port_unlock_irq(&sport->port); + + return 0; + } +@@ -423,7 +423,7 @@ sa1100_set_termios(struct uart_port *port, struct ktermios *termios, + + del_timer_sync(&sport->timer); + +- spin_lock_irqsave(&sport->port.lock, flags); ++ uart_port_lock_irqsave(&sport->port, &flags); + + sport->port.read_status_mask &= UTSR0_TO_SM(UTSR0_TFS); + sport->port.read_status_mask |= UTSR1_TO_SM(UTSR1_ROR); +@@ -485,7 +485,7 @@ sa1100_set_termios(struct uart_port *port, struct ktermios *termios, + if (UART_ENABLE_MS(&sport->port, termios->c_cflag)) + sa1100_enable_ms(&sport->port); + +- spin_unlock_irqrestore(&sport->port.lock, flags); ++ uart_port_unlock_irqrestore(&sport->port, flags); + } + + static const char *sa1100_type(struct uart_port *port) +diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c +index 5a4d88e13..a82b65155 100644 +--- a/drivers/tty/serial/samsung_tty.c ++++ b/drivers/tty/serial/samsung_tty.c +@@ -248,7 +248,7 @@ static void s3c24xx_serial_rx_enable(struct uart_port *port) + unsigned int ucon, ufcon; + int count = 10000; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + while (--count && !s3c24xx_serial_txempty_nofifo(port)) + udelay(100); +@@ -262,7 +262,7 @@ static void s3c24xx_serial_rx_enable(struct uart_port *port) + wr_regl(port, S3C2410_UCON, ucon); + + ourport->rx_enabled = 1; +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void s3c24xx_serial_rx_disable(struct uart_port *port) +@@ -271,14 +271,14 @@ static void s3c24xx_serial_rx_disable(struct uart_port *port) + unsigned long flags; + unsigned int ucon; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + ucon = rd_regl(port, S3C2410_UCON); + ucon &= ~S3C2410_UCON_RXIRQMODE; + wr_regl(port, S3C2410_UCON, ucon); + + ourport->rx_enabled = 0; +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void s3c24xx_serial_stop_tx(struct uart_port *port) +@@ -344,7 +344,7 @@ static void s3c24xx_serial_tx_dma_complete(void *args) + dma->tx_transfer_addr, dma->tx_size, + DMA_TO_DEVICE); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + uart_xmit_advance(port, count); + ourport->tx_in_progress = 0; +@@ -353,7 +353,7 @@ static void s3c24xx_serial_tx_dma_complete(void *args) + uart_write_wakeup(port); + + s3c24xx_serial_start_next_tx(ourport); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void enable_tx_dma(struct s3c24xx_uart_port *ourport) +@@ -619,7 +619,7 @@ static void s3c24xx_serial_rx_dma_complete(void *args) + received = dma->rx_bytes_requested - state.residue; + async_tx_ack(dma->rx_desc); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + if (received) + s3c24xx_uart_copy_rx_to_tty(ourport, t, received); +@@ -631,7 +631,7 @@ static void s3c24xx_serial_rx_dma_complete(void *args) + + s3c64xx_start_rx_dma(ourport); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void s3c64xx_start_rx_dma(struct s3c24xx_uart_port *ourport) +@@ -722,7 +722,7 @@ static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id) + utrstat = rd_regl(port, S3C2410_UTRSTAT); + rd_regl(port, S3C2410_UFSTAT); + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + if (!(utrstat & S3C2410_UTRSTAT_TIMEOUT)) { + s3c64xx_start_rx_dma(ourport); +@@ -751,7 +751,7 @@ static irqreturn_t s3c24xx_serial_rx_chars_dma(void *dev_id) + wr_regl(port, S3C2410_UTRSTAT, S3C2410_UTRSTAT_TIMEOUT); + + finish: +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -849,9 +849,9 @@ static irqreturn_t s3c24xx_serial_rx_chars_pio(void *dev_id) + struct s3c24xx_uart_port *ourport = dev_id; + struct uart_port *port = &ourport->port; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + s3c24xx_serial_rx_drain_fifo(ourport); +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -932,11 +932,11 @@ static irqreturn_t s3c24xx_serial_tx_irq(int irq, void *id) + struct s3c24xx_uart_port *ourport = id; + struct uart_port *port = &ourport->port; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + s3c24xx_serial_tx_chars(ourport); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + return IRQ_HANDLED; + } + +@@ -1032,7 +1032,7 @@ static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + unsigned int ucon; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + ucon = rd_regl(port, S3C2410_UCON); + +@@ -1043,7 +1043,7 @@ static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state) + + wr_regl(port, S3C2410_UCON, ucon); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p) +@@ -1302,7 +1302,7 @@ static int s3c64xx_serial_startup(struct uart_port *port) + ourport->rx_enabled = 1; + ourport->tx_enabled = 0; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + ufcon = rd_regl(port, S3C2410_UFCON); + ufcon |= S3C2410_UFCON_RESETRX | S5PV210_UFCON_RXTRIG8; +@@ -1312,7 +1312,7 @@ static int s3c64xx_serial_startup(struct uart_port *port) + + enable_rx_pio(ourport); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* Enable Rx Interrupt */ + s3c24xx_clear_bit(port, S3C64XX_UINTM_RXD, S3C64XX_UINTM); +@@ -1340,7 +1340,7 @@ static int apple_s5l_serial_startup(struct uart_port *port) + ourport->rx_enabled = 1; + ourport->tx_enabled = 0; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + ufcon = rd_regl(port, S3C2410_UFCON); + ufcon |= S3C2410_UFCON_RESETRX | S5PV210_UFCON_RXTRIG8; +@@ -1350,7 +1350,7 @@ static int apple_s5l_serial_startup(struct uart_port *port) + + enable_rx_pio(ourport); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* Enable Rx Interrupt */ + s3c24xx_set_bit(port, APPLE_S5L_UCON_RXTHRESH_ENA, S3C2410_UCON); +@@ -1625,7 +1625,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, + ulcon |= S3C2410_LCON_PNONE; + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + dev_dbg(port->dev, + "setting ulcon to %08x, brddiv to %d, udivslot %08x\n", +@@ -1683,7 +1683,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, + if ((termios->c_cflag & CREAD) == 0) + port->ignore_status_mask |= RXSTAT_DUMMY_READ; + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *s3c24xx_serial_type(struct uart_port *port) +@@ -2375,14 +2375,14 @@ s3c24xx_serial_console_write(struct console *co, const char *s, + if (cons_uart->sysrq) + locked = false; + else if (oops_in_progress) +- locked = spin_trylock_irqsave(&cons_uart->lock, flags); ++ locked = uart_port_trylock_irqsave(cons_uart, &flags); + else +- spin_lock_irqsave(&cons_uart->lock, flags); ++ uart_port_lock_irqsave(cons_uart, &flags); + + uart_console_write(cons_uart, s, count, s3c24xx_serial_console_putchar); + + if (locked) +- spin_unlock_irqrestore(&cons_uart->lock, flags); ++ uart_port_unlock_irqrestore(cons_uart, flags); + } + + /* Shouldn't be __init, as it can be instantiated from other module */ +diff --git a/drivers/tty/serial/sb1250-duart.c b/drivers/tty/serial/sb1250-duart.c +index f3cd69346..dbec29d9a 100644 +--- a/drivers/tty/serial/sb1250-duart.c ++++ b/drivers/tty/serial/sb1250-duart.c +@@ -610,7 +610,7 @@ static void sbd_set_termios(struct uart_port *uport, struct ktermios *termios, + else + aux &= ~M_DUART_CTS_CHNG_ENA; + +- spin_lock(&uport->lock); ++ uart_port_lock(uport); + + if (sport->tx_stopped) + command |= M_DUART_TX_DIS; +@@ -632,7 +632,7 @@ static void sbd_set_termios(struct uart_port *uport, struct ktermios *termios, + + write_sbdchn(sport, R_DUART_CMD, command); + +- spin_unlock(&uport->lock); ++ uart_port_unlock(uport); + } + + +@@ -839,22 +839,22 @@ static void sbd_console_write(struct console *co, const char *s, + unsigned int mask; + + /* Disable transmit interrupts and enable the transmitter. */ +- spin_lock_irqsave(&uport->lock, flags); ++ uart_port_lock_irqsave(uport, &flags); + mask = read_sbdshr(sport, R_DUART_IMRREG((uport->line) % 2)); + write_sbdshr(sport, R_DUART_IMRREG((uport->line) % 2), + mask & ~M_DUART_IMR_TX); + write_sbdchn(sport, R_DUART_CMD, M_DUART_TX_EN); +- spin_unlock_irqrestore(&uport->lock, flags); ++ uart_port_unlock_irqrestore(uport, flags); + + uart_console_write(&sport->port, s, count, sbd_console_putchar); + + /* Restore transmit interrupts and the transmitter enable. */ +- spin_lock_irqsave(&uport->lock, flags); ++ uart_port_lock_irqsave(uport, &flags); + sbd_line_drain(sport); + if (sport->tx_stopped) + write_sbdchn(sport, R_DUART_CMD, M_DUART_TX_DIS); + write_sbdshr(sport, R_DUART_IMRREG((uport->line) % 2), mask); +- spin_unlock_irqrestore(&uport->lock, flags); ++ uart_port_unlock_irqrestore(uport, flags); + } + + static int __init sbd_console_setup(struct console *co, char *options) +diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c +index d4ec943cb..6d4006b41 100644 +--- a/drivers/tty/serial/serial-tegra.c ++++ b/drivers/tty/serial/serial-tegra.c +@@ -411,7 +411,7 @@ static int tegra_set_baudrate(struct tegra_uart_port *tup, unsigned int baud) + divisor = DIV_ROUND_CLOSEST(rate, baud * 16); + } + +- spin_lock_irqsave(&tup->uport.lock, flags); ++ uart_port_lock_irqsave(&tup->uport, &flags); + lcr = tup->lcr_shadow; + lcr |= UART_LCR_DLAB; + tegra_uart_write(tup, lcr, UART_LCR); +@@ -424,7 +424,7 @@ static int tegra_set_baudrate(struct tegra_uart_port *tup, unsigned int baud) + + /* Dummy read to ensure the write is posted */ + tegra_uart_read(tup, UART_SCR); +- spin_unlock_irqrestore(&tup->uport.lock, flags); ++ uart_port_unlock_irqrestore(&tup->uport, flags); + + tup->current_baud = baud; + +@@ -522,13 +522,13 @@ static void tegra_uart_tx_dma_complete(void *args) + dmaengine_tx_status(tup->tx_dma_chan, tup->tx_cookie, &state); + count = tup->tx_bytes_requested - state.residue; + async_tx_ack(tup->tx_dma_desc); +- spin_lock_irqsave(&tup->uport.lock, flags); ++ uart_port_lock_irqsave(&tup->uport, &flags); + uart_xmit_advance(&tup->uport, count); + tup->tx_in_progress = 0; + if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) + uart_write_wakeup(&tup->uport); + tegra_uart_start_next_tx(tup); +- spin_unlock_irqrestore(&tup->uport.lock, flags); ++ uart_port_unlock_irqrestore(&tup->uport, flags); + } + + static int tegra_uart_start_tx_dma(struct tegra_uart_port *tup, +@@ -598,13 +598,13 @@ static unsigned int tegra_uart_tx_empty(struct uart_port *u) + unsigned int ret = 0; + unsigned long flags; + +- spin_lock_irqsave(&u->lock, flags); ++ uart_port_lock_irqsave(u, &flags); + if (!tup->tx_in_progress) { + unsigned long lsr = tegra_uart_read(tup, UART_LSR); + if ((lsr & TX_EMPTY_STATUS) == TX_EMPTY_STATUS) + ret = TIOCSER_TEMT; + } +- spin_unlock_irqrestore(&u->lock, flags); ++ uart_port_unlock_irqrestore(u, flags); + return ret; + } + +@@ -727,7 +727,7 @@ static void tegra_uart_rx_dma_complete(void *args) + struct dma_tx_state state; + enum dma_status status; + +- spin_lock_irqsave(&u->lock, flags); ++ uart_port_lock_irqsave(u, &flags); + + status = dmaengine_tx_status(tup->rx_dma_chan, tup->rx_cookie, &state); + +@@ -749,7 +749,7 @@ static void tegra_uart_rx_dma_complete(void *args) + set_rts(tup, true); + + done: +- spin_unlock_irqrestore(&u->lock, flags); ++ uart_port_unlock_irqrestore(u, flags); + } + + static void tegra_uart_terminate_rx_dma(struct tegra_uart_port *tup) +@@ -836,7 +836,7 @@ static irqreturn_t tegra_uart_isr(int irq, void *data) + bool is_rx_int = false; + unsigned long flags; + +- spin_lock_irqsave(&u->lock, flags); ++ uart_port_lock_irqsave(u, &flags); + while (1) { + iir = tegra_uart_read(tup, UART_IIR); + if (iir & UART_IIR_NO_INT) { +@@ -852,7 +852,7 @@ static irqreturn_t tegra_uart_isr(int irq, void *data) + } else if (is_rx_start) { + tegra_uart_start_rx_dma(tup); + } +- spin_unlock_irqrestore(&u->lock, flags); ++ uart_port_unlock_irqrestore(u, flags); + return IRQ_HANDLED; + } + +@@ -969,11 +969,11 @@ static void tegra_uart_hw_deinit(struct tegra_uart_port *tup) + } + } + +- spin_lock_irqsave(&tup->uport.lock, flags); ++ uart_port_lock_irqsave(&tup->uport, &flags); + /* Reset the Rx and Tx FIFOs */ + tegra_uart_fifo_reset(tup, UART_FCR_CLEAR_XMIT | UART_FCR_CLEAR_RCVR); + tup->current_baud = 0; +- spin_unlock_irqrestore(&tup->uport.lock, flags); ++ uart_port_unlock_irqrestore(&tup->uport, flags); + + tup->rx_in_progress = 0; + tup->tx_in_progress = 0; +@@ -1292,7 +1292,7 @@ static void tegra_uart_set_termios(struct uart_port *u, + int ret; + + max_divider *= 16; +- spin_lock_irqsave(&u->lock, flags); ++ uart_port_lock_irqsave(u, &flags); + + /* Changing configuration, it is safe to stop any rx now */ + if (tup->rts_active) +@@ -1341,7 +1341,7 @@ static void tegra_uart_set_termios(struct uart_port *u, + baud = uart_get_baud_rate(u, termios, oldtermios, + parent_clk_rate/max_divider, + parent_clk_rate/16); +- spin_unlock_irqrestore(&u->lock, flags); ++ uart_port_unlock_irqrestore(u, flags); + ret = tegra_set_baudrate(tup, baud); + if (ret < 0) { + dev_err(tup->uport.dev, "Failed to set baud rate\n"); +@@ -1349,7 +1349,7 @@ static void tegra_uart_set_termios(struct uart_port *u, + } + if (tty_termios_baud_rate(termios)) + tty_termios_encode_baud_rate(termios, baud, baud); +- spin_lock_irqsave(&u->lock, flags); ++ uart_port_lock_irqsave(u, &flags); + + /* Flow control */ + if (termios->c_cflag & CRTSCTS) { +@@ -1382,7 +1382,7 @@ static void tegra_uart_set_termios(struct uart_port *u, + if (termios->c_iflag & IGNBRK) + tup->uport.ignore_status_mask |= UART_LSR_BI; + +- spin_unlock_irqrestore(&u->lock, flags); ++ uart_port_unlock_irqrestore(u, flags); + } + + static const char *tegra_uart_type(struct uart_port *u) +diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c +index 2eceef54e..6cd64ccc2 100644 +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -79,7 +79,7 @@ static inline void uart_port_deref(struct uart_port *uport) + ({ \ + struct uart_port *__uport = uart_port_ref(state); \ + if (__uport) \ +- spin_lock_irqsave(&__uport->lock, flags); \ ++ uart_port_lock_irqsave(__uport, &flags); \ + __uport; \ + }) + +@@ -87,7 +87,7 @@ static inline void uart_port_deref(struct uart_port *uport) + ({ \ + struct uart_port *__uport = uport; \ + if (__uport) { \ +- spin_unlock_irqrestore(&__uport->lock, flags); \ ++ uart_port_unlock_irqrestore(__uport, flags); \ + uart_port_deref(__uport); \ + } \ + }) +@@ -179,12 +179,12 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear) + unsigned long flags; + unsigned int old; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + old = port->mctrl; + port->mctrl = (old & ~clear) | set; + if (old != port->mctrl && !(port->rs485.flags & SER_RS485_ENABLED)) + port->ops->set_mctrl(port, port->mctrl); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + #define uart_set_mctrl(port, set) uart_update_mctrl(port, set, 0) +@@ -219,7 +219,7 @@ static void uart_change_line_settings(struct tty_struct *tty, struct uart_state + /* + * Set modem status enables based on termios cflag + */ +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + if (termios->c_cflag & CRTSCTS) + uport->status |= UPSTAT_CTS_ENABLE; + else +@@ -240,7 +240,7 @@ static void uart_change_line_settings(struct tty_struct *tty, struct uart_state + else + __uart_start(state); + } +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + } + + /* +@@ -715,11 +715,11 @@ static void uart_send_xchar(struct tty_struct *tty, char ch) + if (port->ops->send_xchar) + port->ops->send_xchar(port, ch); + else { +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + port->x_char = ch; + if (ch) + port->ops->start_tx(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + uart_port_deref(port); + } +@@ -1098,9 +1098,9 @@ static int uart_tiocmget(struct tty_struct *tty) + + if (!tty_io_error(tty)) { + result = uport->mctrl; +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + result |= uport->ops->get_mctrl(uport); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + } + out: + mutex_unlock(&port->mutex); +@@ -1236,16 +1236,16 @@ static int uart_wait_modem_status(struct uart_state *state, unsigned long arg) + uport = uart_port_ref(state); + if (!uport) + return -EIO; +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + memcpy(&cprev, &uport->icount, sizeof(struct uart_icount)); + uart_enable_ms(uport); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + + add_wait_queue(&port->delta_msr_wait, &wait); + for (;;) { +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + memcpy(&cnow, &uport->icount, sizeof(struct uart_icount)); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + + set_current_state(TASK_INTERRUPTIBLE); + +@@ -1290,9 +1290,9 @@ static int uart_get_icount(struct tty_struct *tty, + uport = uart_port_ref(state); + if (!uport) + return -EIO; +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + memcpy(&cnow, &uport->icount, sizeof(struct uart_icount)); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + uart_port_deref(uport); + + icount->cts = cnow.cts; +@@ -1445,9 +1445,9 @@ static int uart_rs485_config(struct uart_port *port) + uart_set_rs485_termination(port, rs485); + uart_set_rs485_rx_during_tx(port, rs485); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + ret = port->rs485_config(port, NULL, rs485); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + if (ret) { + memset(rs485, 0, sizeof(*rs485)); + /* unset GPIOs */ +@@ -1464,9 +1464,9 @@ static int uart_get_rs485_config(struct uart_port *port, + unsigned long flags; + struct serial_rs485 aux; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + aux = port->rs485; +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (copy_to_user(rs485, &aux, sizeof(aux))) + return -EFAULT; +@@ -1494,7 +1494,7 @@ static int uart_set_rs485_config(struct tty_struct *tty, struct uart_port *port, + uart_set_rs485_termination(port, &rs485); + uart_set_rs485_rx_during_tx(port, &rs485); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + ret = port->rs485_config(port, &tty->termios, &rs485); + if (!ret) { + port->rs485 = rs485; +@@ -1503,7 +1503,7 @@ static int uart_set_rs485_config(struct tty_struct *tty, struct uart_port *port, + if (!(rs485.flags & SER_RS485_ENABLED)) + port->ops->set_mctrl(port, port->mctrl); + } +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + if (ret) { + /* restore old GPIO settings */ + gpiod_set_value_cansleep(port->rs485_term_gpio, +@@ -1528,9 +1528,9 @@ static int uart_get_iso7816_config(struct uart_port *port, + if (!port->iso7816_config) + return -ENOTTY; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + aux = port->iso7816; +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (copy_to_user(iso7816, &aux, sizeof(aux))) + return -EFAULT; +@@ -1559,9 +1559,9 @@ static int uart_set_iso7816_config(struct uart_port *port, + if (iso7816.reserved[i]) + return -EINVAL; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + ret = port->iso7816_config(port, &iso7816); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + if (ret) + return ret; + +@@ -1778,9 +1778,9 @@ static void uart_tty_port_shutdown(struct tty_port *port) + if (WARN(!uport, "detached port still initialized!\n")) + return; + +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + uport->ops->stop_rx(uport); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + + serial_base_port_shutdown(uport); + uart_port_shutdown(port); +@@ -1795,11 +1795,11 @@ static void uart_tty_port_shutdown(struct tty_port *port) + /* + * Free the transmit buffer. + */ +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + uart_circ_clear(&state->xmit); + buf = state->xmit.buf; + state->xmit.buf = NULL; +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + + free_page((unsigned long)buf); + +@@ -1942,10 +1942,10 @@ static bool uart_carrier_raised(struct tty_port *port) + */ + if (WARN_ON(!uport)) + return true; +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + uart_enable_ms(uport); + mctrl = uport->ops->get_mctrl(uport); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + uart_port_deref(uport); + + return mctrl & TIOCM_CAR; +@@ -2062,9 +2062,9 @@ static void uart_line_info(struct seq_file *m, struct uart_driver *drv, int i) + pm_state = state->pm_state; + if (pm_state != UART_PM_STATE_ON) + uart_change_pm(state, UART_PM_STATE_ON); +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + status = uport->ops->get_mctrl(uport); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + if (pm_state != UART_PM_STATE_ON) + uart_change_pm(state, pm_state); + +@@ -2403,9 +2403,9 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) + */ + if (!console_suspend_enabled && uart_console(uport)) { + if (uport->ops->start_rx) { +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + uport->ops->stop_rx(uport); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + } + goto unlock; + } +@@ -2420,7 +2420,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) + tty_port_set_suspended(port, true); + tty_port_set_initialized(port, false); + +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + ops->stop_tx(uport); + if (!(uport->rs485.flags & SER_RS485_ENABLED)) + ops->set_mctrl(uport, 0); +@@ -2428,7 +2428,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) + mctrl = uport->mctrl; + uport->mctrl = 0; + ops->stop_rx(uport); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + + /* + * Wait for the transmitter to empty. +@@ -2500,9 +2500,9 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) + uart_change_pm(state, UART_PM_STATE_ON); + uport->ops->set_termios(uport, &termios, NULL); + if (!console_suspend_enabled && uport->ops->start_rx) { +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + uport->ops->start_rx(uport); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + } + if (console_suspend_enabled) + console_start(uport->cons); +@@ -2513,10 +2513,10 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) + int ret; + + uart_change_pm(state, UART_PM_STATE_ON); +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + if (!(uport->rs485.flags & SER_RS485_ENABLED)) + ops->set_mctrl(uport, 0); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + if (console_suspend_enabled || !uart_console(uport)) { + /* Protected by port mutex for now */ + struct tty_struct *tty = port->tty; +@@ -2526,11 +2526,11 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport) + if (tty) + uart_change_line_settings(tty, state, NULL); + uart_rs485_config(uport); +- spin_lock_irq(&uport->lock); ++ uart_port_lock_irq(uport); + if (!(uport->rs485.flags & SER_RS485_ENABLED)) + ops->set_mctrl(uport, uport->mctrl); + ops->start_tx(uport); +- spin_unlock_irq(&uport->lock); ++ uart_port_unlock_irq(uport); + tty_port_set_initialized(port, true); + } else { + /* +@@ -2642,11 +2642,11 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state, + * keep the DTR setting that is set in uart_set_options() + * We probably don't need a spinlock around this, but + */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + port->mctrl &= TIOCM_DTR; + if (!(port->rs485.flags & SER_RS485_ENABLED)) + port->ops->set_mctrl(port, port->mctrl); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + uart_rs485_config(port); + +diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c +index 7d5aaa8d4..e51ca593a 100644 +--- a/drivers/tty/serial/serial_mctrl_gpio.c ++++ b/drivers/tty/serial/serial_mctrl_gpio.c +@@ -184,7 +184,7 @@ static irqreturn_t mctrl_gpio_irq_handle(int irq, void *context) + + mctrl_gpio_get(gpios, &mctrl); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + mctrl_diff = mctrl ^ gpios->mctrl_prev; + gpios->mctrl_prev = mctrl; +@@ -205,7 +205,7 @@ static irqreturn_t mctrl_gpio_irq_handle(int irq, void *context) + wake_up_interruptible(&port->state->port.delta_msr_wait); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return IRQ_HANDLED; + } +diff --git a/drivers/tty/serial/serial_port.c b/drivers/tty/serial/serial_port.c +index d622a9297..7d51e66ec 100644 +--- a/drivers/tty/serial/serial_port.c ++++ b/drivers/tty/serial/serial_port.c +@@ -35,14 +35,14 @@ static int serial_port_runtime_resume(struct device *dev) + goto out; + + /* Flush any pending TX for the port */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (!port_dev->tx_enabled) + goto unlock; + if (__serial_port_busy(port)) + port->ops->start_tx(port); + + unlock: +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + out: + pm_runtime_mark_last_busy(dev); +diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c +index be08fb6f7..eaa980722 100644 +--- a/drivers/tty/serial/serial_txx9.c ++++ b/drivers/tty/serial/serial_txx9.c +@@ -335,13 +335,13 @@ static irqreturn_t serial_txx9_interrupt(int irq, void *dev_id) + unsigned int status; + + while (1) { +- spin_lock(&up->lock); ++ uart_port_lock(up); + status = sio_in(up, TXX9_SIDISR); + if (!(sio_in(up, TXX9_SIDICR) & TXX9_SIDICR_TIE)) + status &= ~TXX9_SIDISR_TDIS; + if (!(status & (TXX9_SIDISR_TDIS | TXX9_SIDISR_RDIS | + TXX9_SIDISR_TOUT))) { +- spin_unlock(&up->lock); ++ uart_port_unlock(up); + break; + } + +@@ -353,7 +353,7 @@ static irqreturn_t serial_txx9_interrupt(int irq, void *dev_id) + sio_mask(up, TXX9_SIDISR, + TXX9_SIDISR_TDIS | TXX9_SIDISR_RDIS | + TXX9_SIDISR_TOUT); +- spin_unlock(&up->lock); ++ uart_port_unlock(up); + + if (pass_counter++ > PASS_LIMIT) + break; +@@ -367,9 +367,9 @@ static unsigned int serial_txx9_tx_empty(struct uart_port *up) + unsigned long flags; + unsigned int ret; + +- spin_lock_irqsave(&up->lock, flags); ++ uart_port_lock_irqsave(up, &flags); + ret = (sio_in(up, TXX9_SICISR) & TXX9_SICISR_TXALS) ? TIOCSER_TEMT : 0; +- spin_unlock_irqrestore(&up->lock, flags); ++ uart_port_unlock_irqrestore(up, flags); + + return ret; + } +@@ -399,12 +399,12 @@ static void serial_txx9_break_ctl(struct uart_port *up, int break_state) + { + unsigned long flags; + +- spin_lock_irqsave(&up->lock, flags); ++ uart_port_lock_irqsave(up, &flags); + if (break_state == -1) + sio_set(up, TXX9_SIFLCR, TXX9_SIFLCR_TBRK); + else + sio_mask(up, TXX9_SIFLCR, TXX9_SIFLCR_TBRK); +- spin_unlock_irqrestore(&up->lock, flags); ++ uart_port_unlock_irqrestore(up, flags); + } + + #if defined(CONFIG_SERIAL_TXX9_CONSOLE) || defined(CONFIG_CONSOLE_POLL) +@@ -517,9 +517,9 @@ static int serial_txx9_startup(struct uart_port *up) + /* + * Now, initialize the UART + */ +- spin_lock_irqsave(&up->lock, flags); ++ uart_port_lock_irqsave(up, &flags); + serial_txx9_set_mctrl(up, up->mctrl); +- spin_unlock_irqrestore(&up->lock, flags); ++ uart_port_unlock_irqrestore(up, flags); + + /* Enable RX/TX */ + sio_mask(up, TXX9_SIFLCR, TXX9_SIFLCR_RSDE | TXX9_SIFLCR_TSDE); +@@ -541,9 +541,9 @@ static void serial_txx9_shutdown(struct uart_port *up) + */ + sio_out(up, TXX9_SIDICR, 0); /* disable all intrs */ + +- spin_lock_irqsave(&up->lock, flags); ++ uart_port_lock_irqsave(up, &flags); + serial_txx9_set_mctrl(up, up->mctrl); +- spin_unlock_irqrestore(&up->lock, flags); ++ uart_port_unlock_irqrestore(up, flags); + + /* + * Disable break condition +@@ -625,7 +625,7 @@ serial_txx9_set_termios(struct uart_port *up, struct ktermios *termios, + * Ok, we're now changing the port state. Do it with + * interrupts disabled. + */ +- spin_lock_irqsave(&up->lock, flags); ++ uart_port_lock_irqsave(up, &flags); + + /* + * Update the per-port timeout. +@@ -676,7 +676,7 @@ serial_txx9_set_termios(struct uart_port *up, struct ktermios *termios, + sio_out(up, TXX9_SIFCR, fcr); + + serial_txx9_set_mctrl(up, up->mctrl); +- spin_unlock_irqrestore(&up->lock, flags); ++ uart_port_unlock_irqrestore(up, flags); + } + + static void +diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c +index a560b729f..84ab434c9 100644 +--- a/drivers/tty/serial/sh-sci.c ++++ b/drivers/tty/serial/sh-sci.c +@@ -1205,7 +1205,7 @@ static void sci_dma_tx_complete(void *arg) + + dev_dbg(port->dev, "%s(%d)\n", __func__, port->line); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + uart_xmit_advance(port, s->tx_dma_len); + +@@ -1229,7 +1229,7 @@ static void sci_dma_tx_complete(void *arg) + } + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* Locking: called with port lock held */ +@@ -1320,7 +1320,7 @@ static void sci_dma_rx_complete(void *arg) + dev_dbg(port->dev, "%s(%d) active cookie %d\n", __func__, port->line, + s->active_rx); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + active = sci_dma_rx_find_active(s); + if (active >= 0) +@@ -1347,20 +1347,20 @@ static void sci_dma_rx_complete(void *arg) + + dma_async_issue_pending(chan); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + dev_dbg(port->dev, "%s: cookie %d #%d, new active cookie %d\n", + __func__, s->cookie_rx[active], active, s->active_rx); + return; + + fail: +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + dev_warn(port->dev, "Failed submitting Rx DMA descriptor\n"); + /* Switch to PIO */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + dmaengine_terminate_async(chan); + sci_dma_rx_chan_invalidate(s); + sci_dma_rx_reenable_irq(s); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void sci_dma_tx_release(struct sci_port *s) +@@ -1409,13 +1409,13 @@ static int sci_dma_rx_submit(struct sci_port *s, bool port_lock_held) + fail: + /* Switch to PIO */ + if (!port_lock_held) +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + if (i) + dmaengine_terminate_async(chan); + sci_dma_rx_chan_invalidate(s); + sci_start_rx(port); + if (!port_lock_held) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + return -EAGAIN; + } + +@@ -1437,14 +1437,14 @@ static void sci_dma_tx_work_fn(struct work_struct *work) + * transmit till the end, and then the rest. Take the port lock to get a + * consistent xmit buffer state. + */ +- spin_lock_irq(&port->lock); ++ uart_port_lock_irq(port); + head = xmit->head; + tail = xmit->tail; + buf = s->tx_dma_addr + tail; + s->tx_dma_len = CIRC_CNT_TO_END(head, tail, UART_XMIT_SIZE); + if (!s->tx_dma_len) { + /* Transmit buffer has been flushed */ +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + return; + } + +@@ -1452,7 +1452,7 @@ static void sci_dma_tx_work_fn(struct work_struct *work) + DMA_MEM_TO_DEV, + DMA_PREP_INTERRUPT | DMA_CTRL_ACK); + if (!desc) { +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + dev_warn(port->dev, "Failed preparing Tx DMA descriptor\n"); + goto switch_to_pio; + } +@@ -1464,12 +1464,12 @@ static void sci_dma_tx_work_fn(struct work_struct *work) + desc->callback_param = s; + s->cookie_tx = dmaengine_submit(desc); + if (dma_submit_error(s->cookie_tx)) { +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + dev_warn(port->dev, "Failed submitting Tx DMA descriptor\n"); + goto switch_to_pio; + } + +- spin_unlock_irq(&port->lock); ++ uart_port_unlock_irq(port); + dev_dbg(port->dev, "%s: %p: %d...%d, cookie %d\n", + __func__, xmit->buf, tail, head, s->cookie_tx); + +@@ -1477,10 +1477,10 @@ static void sci_dma_tx_work_fn(struct work_struct *work) + return; + + switch_to_pio: +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + s->chan_tx = NULL; + sci_start_tx(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + return; + } + +@@ -1497,17 +1497,17 @@ static enum hrtimer_restart sci_dma_rx_timer_fn(struct hrtimer *t) + + dev_dbg(port->dev, "DMA Rx timed out\n"); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + active = sci_dma_rx_find_active(s); + if (active < 0) { +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + return HRTIMER_NORESTART; + } + + status = dmaengine_tx_status(s->chan_rx, s->active_rx, &state); + if (status == DMA_COMPLETE) { +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + dev_dbg(port->dev, "Cookie %d #%d has already completed\n", + s->active_rx, active); + +@@ -1525,7 +1525,7 @@ static enum hrtimer_restart sci_dma_rx_timer_fn(struct hrtimer *t) + */ + status = dmaengine_tx_status(s->chan_rx, s->active_rx, &state); + if (status == DMA_COMPLETE) { +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + dev_dbg(port->dev, "Transaction complete after DMA engine was stopped"); + return HRTIMER_NORESTART; + } +@@ -1546,7 +1546,7 @@ static enum hrtimer_restart sci_dma_rx_timer_fn(struct hrtimer *t) + + sci_dma_rx_reenable_irq(s); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return HRTIMER_NORESTART; + } +@@ -1770,9 +1770,9 @@ static irqreturn_t sci_tx_interrupt(int irq, void *ptr) + struct uart_port *port = ptr; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + sci_transmit_chars(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return IRQ_HANDLED; + } +@@ -1786,11 +1786,11 @@ static irqreturn_t sci_tx_end_interrupt(int irq, void *ptr) + if (port->type != PORT_SCI) + return sci_tx_interrupt(irq, ptr); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + ctrl = serial_port_in(port, SCSCR); + ctrl &= ~(SCSCR_TE | SCSCR_TEIE); + serial_port_out(port, SCSCR, ctrl); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return IRQ_HANDLED; + } +@@ -2187,7 +2187,7 @@ static void sci_break_ctl(struct uart_port *port, int break_state) + return; + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + scsptr = serial_port_in(port, SCSPTR); + scscr = serial_port_in(port, SCSCR); + +@@ -2201,7 +2201,7 @@ static void sci_break_ctl(struct uart_port *port, int break_state) + + serial_port_out(port, SCSPTR, scsptr); + serial_port_out(port, SCSCR, scscr); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int sci_startup(struct uart_port *port) +@@ -2233,7 +2233,7 @@ static void sci_shutdown(struct uart_port *port) + s->autorts = false; + mctrl_gpio_disable_ms(to_sci_port(port)->gpios); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + sci_stop_rx(port); + sci_stop_tx(port); + /* +@@ -2243,7 +2243,7 @@ static void sci_shutdown(struct uart_port *port) + scr = serial_port_in(port, SCSCR); + serial_port_out(port, SCSCR, scr & + (SCSCR_CKE1 | SCSCR_CKE0 | s->hscif_tot)); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + #ifdef CONFIG_SERIAL_SH_SCI_DMA + if (s->chan_rx_saved) { +@@ -2545,7 +2545,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, + serial_port_out(port, SCCKS, sccks); + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + sci_reset(port); + +@@ -2667,7 +2667,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, + if ((termios->c_cflag & CREAD) != 0) + sci_start_rx(port); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + sci_port_disable(s); + +@@ -3052,9 +3052,9 @@ static void serial_console_write(struct console *co, const char *s, + if (port->sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* first save SCSCR then disable interrupts, keep clock source */ + ctrl = serial_port_in(port, SCSCR); +@@ -3074,7 +3074,7 @@ static void serial_console_write(struct console *co, const char *s, + serial_port_out(port, SCSCR, ctrl); + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int serial_console_setup(struct console *co, char *options) +diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c +index d195c5de5..b296e57a9 100644 +--- a/drivers/tty/serial/sifive.c ++++ b/drivers/tty/serial/sifive.c +@@ -521,11 +521,11 @@ static irqreturn_t sifive_serial_irq(int irq, void *dev_id) + struct sifive_serial_port *ssp = dev_id; + u32 ip; + +- spin_lock(&ssp->port.lock); ++ uart_port_lock(&ssp->port); + + ip = __ssp_readl(ssp, SIFIVE_SERIAL_IP_OFFS); + if (!ip) { +- spin_unlock(&ssp->port.lock); ++ uart_port_unlock(&ssp->port); + return IRQ_NONE; + } + +@@ -534,7 +534,7 @@ static irqreturn_t sifive_serial_irq(int irq, void *dev_id) + if (ip & SIFIVE_SERIAL_IP_TXWM_MASK) + __ssp_transmit_chars(ssp); + +- spin_unlock(&ssp->port.lock); ++ uart_port_unlock(&ssp->port); + + return IRQ_HANDLED; + } +@@ -653,7 +653,7 @@ static void sifive_serial_set_termios(struct uart_port *port, + ssp->port.uartclk / 16); + __ssp_update_baud_rate(ssp, rate); + +- spin_lock_irqsave(&ssp->port.lock, flags); ++ uart_port_lock_irqsave(&ssp->port, &flags); + + /* Update the per-port timeout */ + uart_update_timeout(port, termios->c_cflag, rate); +@@ -670,7 +670,7 @@ static void sifive_serial_set_termios(struct uart_port *port, + if (v != old_v) + __ssp_writel(v, SIFIVE_SERIAL_RXCTRL_OFFS, ssp); + +- spin_unlock_irqrestore(&ssp->port.lock, flags); ++ uart_port_unlock_irqrestore(&ssp->port, flags); + } + + static void sifive_serial_release_port(struct uart_port *port) +@@ -795,9 +795,9 @@ static void sifive_serial_console_write(struct console *co, const char *s, + if (ssp->port.sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock(&ssp->port.lock); ++ locked = uart_port_trylock(&ssp->port); + else +- spin_lock(&ssp->port.lock); ++ uart_port_lock(&ssp->port); + + ier = __ssp_readl(ssp, SIFIVE_SERIAL_IE_OFFS); + __ssp_writel(0, SIFIVE_SERIAL_IE_OFFS, ssp); +@@ -807,7 +807,7 @@ static void sifive_serial_console_write(struct console *co, const char *s, + __ssp_writel(ier, SIFIVE_SERIAL_IE_OFFS, ssp); + + if (locked) +- spin_unlock(&ssp->port.lock); ++ uart_port_unlock(&ssp->port); + local_irq_restore(flags); + } + +diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c +index f328fa572..f257525f9 100644 +--- a/drivers/tty/serial/sprd_serial.c ++++ b/drivers/tty/serial/sprd_serial.c +@@ -247,7 +247,7 @@ static void sprd_complete_tx_dma(void *data) + struct circ_buf *xmit = &port->state->xmit; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + dma_unmap_single(port->dev, sp->tx_dma.phys_addr, + sp->tx_dma.trans_len, DMA_TO_DEVICE); + +@@ -260,7 +260,7 @@ static void sprd_complete_tx_dma(void *data) + sprd_tx_dma_config(port)) + sp->tx_dma.trans_len = 0; + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int sprd_uart_dma_submit(struct uart_port *port, +@@ -429,13 +429,13 @@ static void sprd_complete_rx_dma(void *data) + enum dma_status status; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + status = dmaengine_tx_status(sp->rx_dma.chn, + sp->rx_dma.cookie, &state); + if (status != DMA_COMPLETE) { + sprd_stop_rx(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + return; + } + +@@ -449,7 +449,7 @@ static void sprd_complete_rx_dma(void *data) + if (sprd_start_dma_rx(port)) + sprd_stop_rx(port); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int sprd_start_dma_rx(struct uart_port *port) +@@ -638,12 +638,12 @@ static irqreturn_t sprd_handle_irq(int irq, void *dev_id) + struct uart_port *port = dev_id; + unsigned int ims; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + ims = serial_in(port, SPRD_IMSR); + + if (!ims) { +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + return IRQ_NONE; + } + +@@ -660,7 +660,7 @@ static irqreturn_t sprd_handle_irq(int irq, void *dev_id) + if (ims & SPRD_IMSR_TX_FIFO_EMPTY) + sprd_tx(port); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -727,13 +727,13 @@ static int sprd_startup(struct uart_port *port) + serial_out(port, SPRD_CTL1, fc); + + /* enable interrupt */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + ien = serial_in(port, SPRD_IEN); + ien |= SPRD_IEN_BREAK_DETECT | SPRD_IEN_TIMEOUT; + if (!sp->rx_dma.enable) + ien |= SPRD_IEN_RX_FULL; + serial_out(port, SPRD_IEN, ien); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return 0; + } +@@ -793,7 +793,7 @@ static void sprd_set_termios(struct uart_port *port, struct ktermios *termios, + lcr |= SPRD_LCR_EVEN_PAR; + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* update the per-port timeout */ + uart_update_timeout(port, termios->c_cflag, baud); +@@ -837,7 +837,7 @@ static void sprd_set_termios(struct uart_port *port, struct ktermios *termios, + fc |= RX_TOUT_THLD_DEF | RX_HFC_THLD_DEF; + serial_out(port, SPRD_CTL1, fc); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* Don't rewrite B0 */ + if (tty_termios_baud_rate(termios)) +@@ -974,9 +974,9 @@ static void sprd_console_write(struct console *co, const char *s, + if (port->sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + uart_console_write(port, s, count, sprd_console_putchar); + +@@ -984,7 +984,7 @@ static void sprd_console_write(struct console *co, const char *s, + wait_for_xmitr(port); + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int sprd_console_setup(struct console *co, char *options) +diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c +index 92b9f6894..a821f5d76 100644 +--- a/drivers/tty/serial/st-asc.c ++++ b/drivers/tty/serial/st-asc.c +@@ -319,7 +319,7 @@ static irqreturn_t asc_interrupt(int irq, void *ptr) + struct uart_port *port = ptr; + u32 status; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + status = asc_in(port, ASC_STA); + +@@ -334,7 +334,7 @@ static irqreturn_t asc_interrupt(int irq, void *ptr) + asc_transmit_chars(port); + } + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -452,10 +452,10 @@ static void asc_pm(struct uart_port *port, unsigned int state, + * we can come to turning it off. Note this is not called with + * the port spinlock held. + */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + ctl = asc_in(port, ASC_CTL) & ~ASC_CTL_RUN; + asc_out(port, ASC_CTL, ctl); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + clk_disable_unprepare(ascport->clk); + break; + } +@@ -480,7 +480,7 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios, + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); + cflag = termios->c_cflag; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* read control register */ + ctrl_val = asc_in(port, ASC_CTL); +@@ -594,7 +594,7 @@ static void asc_set_termios(struct uart_port *port, struct ktermios *termios, + /* write final value and enable port */ + asc_out(port, ASC_CTL, (ctrl_val | ASC_CTL_RUN)); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *asc_type(struct uart_port *port) +@@ -849,9 +849,9 @@ static void asc_console_write(struct console *co, const char *s, unsigned count) + if (port->sysrq) + locked = 0; /* asc_interrupt has already claimed the lock */ + else if (oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* + * Disable interrupts so we don't get the IRQ line bouncing +@@ -869,7 +869,7 @@ static void asc_console_write(struct console *co, const char *s, unsigned count) + asc_out(port, ASC_INTEN, intenable); + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int asc_console_setup(struct console *co, char *options) +diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c +index 9ef90bb30..b963f9ccb 100644 +--- a/drivers/tty/serial/stm32-usart.c ++++ b/drivers/tty/serial/stm32-usart.c +@@ -535,7 +535,7 @@ static void stm32_usart_rx_dma_complete(void *arg) + unsigned int size; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + size = stm32_usart_receive_chars(port, false); + uart_unlock_and_check_sysrq_irqrestore(port, flags); + if (size) +@@ -641,9 +641,9 @@ static void stm32_usart_tx_dma_complete(void *arg) + stm32_usart_tx_dma_terminate(stm32port); + + /* Let's see if we have pending data to send */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + stm32_usart_transmit_chars(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void stm32_usart_tx_interrupt_enable(struct uart_port *port) +@@ -892,7 +892,7 @@ static irqreturn_t stm32_usart_interrupt(int irq, void *ptr) + if (!stm32_port->throttled) { + if (((sr & USART_SR_RXNE) && !stm32_usart_rx_dma_started(stm32_port)) || + ((sr & USART_SR_ERR_MASK) && stm32_usart_rx_dma_started(stm32_port))) { +- spin_lock(&port->lock); ++ uart_port_lock(port); + size = stm32_usart_receive_chars(port, false); + uart_unlock_and_check_sysrq(port); + if (size) +@@ -902,15 +902,15 @@ static irqreturn_t stm32_usart_interrupt(int irq, void *ptr) + } + + if ((sr & USART_SR_TXE) && !(stm32_port->tx_ch)) { +- spin_lock(&port->lock); ++ uart_port_lock(port); + stm32_usart_transmit_chars(port); +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + ret = IRQ_HANDLED; + } + + /* Receiver timeout irq for DMA RX */ + if (stm32_usart_rx_dma_started(stm32_port) && !stm32_port->throttled) { +- spin_lock(&port->lock); ++ uart_port_lock(port); + size = stm32_usart_receive_chars(port, false); + uart_unlock_and_check_sysrq(port); + if (size) +@@ -999,7 +999,7 @@ static void stm32_usart_throttle(struct uart_port *port) + const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* + * Pause DMA transfer, so the RX data gets queued into the FIFO. +@@ -1012,7 +1012,7 @@ static void stm32_usart_throttle(struct uart_port *port) + stm32_usart_clr_bits(port, ofs->cr3, stm32_port->cr3_irq); + + stm32_port->throttled = true; +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* Unthrottle the remote, the input buffer can now accept data. */ +@@ -1022,7 +1022,7 @@ static void stm32_usart_unthrottle(struct uart_port *port) + const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + stm32_usart_set_bits(port, ofs->cr1, stm32_port->cr1_irq); + if (stm32_port->cr3_irq) + stm32_usart_set_bits(port, ofs->cr3, stm32_port->cr3_irq); +@@ -1036,7 +1036,7 @@ static void stm32_usart_unthrottle(struct uart_port *port) + if (stm32_port->rx_ch) + stm32_usart_rx_dma_start_or_resume(port); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* Receive stop */ +@@ -1165,7 +1165,7 @@ static void stm32_usart_set_termios(struct uart_port *port, + + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 8); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + ret = readl_relaxed_poll_timeout_atomic(port->membase + ofs->isr, + isr, +@@ -1356,7 +1356,7 @@ static void stm32_usart_set_termios(struct uart_port *port, + writel_relaxed(cr1, port->membase + ofs->cr1); + + stm32_usart_set_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + /* Handle modem control interrupts */ + if (UART_ENABLE_MS(port, termios->c_cflag)) +@@ -1406,9 +1406,9 @@ static void stm32_usart_pm(struct uart_port *port, unsigned int state, + pm_runtime_get_sync(port->dev); + break; + case UART_PM_STATE_OFF: +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + stm32_usart_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit)); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + pm_runtime_put_sync(port->dev); + break; + } +@@ -1891,9 +1891,9 @@ static void stm32_usart_console_write(struct console *co, const char *s, + int locked = 1; + + if (oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Save and disable interrupts, enable the transmitter */ + old_cr1 = readl_relaxed(port->membase + ofs->cr1); +@@ -1907,7 +1907,7 @@ static void stm32_usart_console_write(struct console *co, const char *s, + writel_relaxed(old_cr1, port->membase + ofs->cr1); + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int stm32_usart_console_setup(struct console *co, char *options) +@@ -2042,7 +2042,7 @@ static int __maybe_unused stm32_usart_serial_en_wakeup(struct uart_port *port, + * low-power mode. + */ + if (stm32_port->rx_ch) { +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + /* Poll data from DMA RX buffer if any */ + if (!stm32_usart_rx_dma_pause(stm32_port)) + size += stm32_usart_receive_chars(port, true); +diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c +index c671d674b..5bfc0040f 100644 +--- a/drivers/tty/serial/sunhv.c ++++ b/drivers/tty/serial/sunhv.c +@@ -217,10 +217,10 @@ static irqreturn_t sunhv_interrupt(int irq, void *dev_id) + struct tty_port *tport; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + tport = receive_chars(port); + transmit_chars(port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (tport) + tty_flip_buffer_push(tport); +@@ -271,7 +271,7 @@ static void sunhv_send_xchar(struct uart_port *port, char ch) + if (ch == __DISABLED_CHAR) + return; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + while (limit-- > 0) { + long status = sun4v_con_putchar(ch); +@@ -280,7 +280,7 @@ static void sunhv_send_xchar(struct uart_port *port, char ch) + udelay(1); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* port->lock held by caller. */ +@@ -295,7 +295,7 @@ static void sunhv_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + int limit = 10000; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + while (limit-- > 0) { + long status = sun4v_con_putchar(CON_BREAK); +@@ -304,7 +304,7 @@ static void sunhv_break_ctl(struct uart_port *port, int break_state) + udelay(1); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + } + +@@ -328,7 +328,7 @@ static void sunhv_set_termios(struct uart_port *port, struct ktermios *termios, + unsigned int iflag, cflag; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + iflag = termios->c_iflag; + cflag = termios->c_cflag; +@@ -343,7 +343,7 @@ static void sunhv_set_termios(struct uart_port *port, struct ktermios *termios, + uart_update_timeout(port, cflag, + (port->uartclk / (16 * quot))); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *sunhv_type(struct uart_port *port) +@@ -437,9 +437,9 @@ static void sunhv_console_write_paged(struct console *con, const char *s, unsign + int locked = 1; + + if (port->sysrq || oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + while (n > 0) { + unsigned long ra = __pa(con_write_page); +@@ -470,7 +470,7 @@ static void sunhv_console_write_paged(struct console *con, const char *s, unsign + } + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static inline void sunhv_console_putchar(struct uart_port *port, char c) +@@ -492,9 +492,9 @@ static void sunhv_console_write_bychar(struct console *con, const char *s, unsig + int i, locked = 1; + + if (port->sysrq || oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + for (i = 0; i < n; i++) { + if (*s == '\n') +@@ -503,7 +503,7 @@ static void sunhv_console_write_bychar(struct console *con, const char *s, unsig + } + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static struct console sunhv_console = { +diff --git a/drivers/tty/serial/sunplus-uart.c b/drivers/tty/serial/sunplus-uart.c +index 3aacd5eb4..4251f4e1b 100644 +--- a/drivers/tty/serial/sunplus-uart.c ++++ b/drivers/tty/serial/sunplus-uart.c +@@ -184,7 +184,7 @@ static void sunplus_break_ctl(struct uart_port *port, int ctl) + unsigned long flags; + unsigned int lcr; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + lcr = readl(port->membase + SUP_UART_LCR); + +@@ -195,7 +195,7 @@ static void sunplus_break_ctl(struct uart_port *port, int ctl) + + writel(lcr, port->membase + SUP_UART_LCR); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void transmit_chars(struct uart_port *port) +@@ -277,7 +277,7 @@ static irqreturn_t sunplus_uart_irq(int irq, void *args) + struct uart_port *port = args; + unsigned int isc; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + isc = readl(port->membase + SUP_UART_ISC); + +@@ -287,7 +287,7 @@ static irqreturn_t sunplus_uart_irq(int irq, void *args) + if (isc & SUP_UART_ISC_TX) + transmit_chars(port); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -302,14 +302,14 @@ static int sunplus_startup(struct uart_port *port) + if (ret) + return ret; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + /* isc define Bit[7:4] int setting, Bit[3:0] int status + * isc register will clean Bit[3:0] int status after read + * only do a write to Bit[7:4] int setting + */ + isc |= SUP_UART_ISC_RXM; + writel(isc, port->membase + SUP_UART_ISC); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return 0; + } +@@ -318,13 +318,13 @@ static void sunplus_shutdown(struct uart_port *port) + { + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + /* isc define Bit[7:4] int setting, Bit[3:0] int status + * isc register will clean Bit[3:0] int status after read + * only do a write to Bit[7:4] int setting + */ + writel(0, port->membase + SUP_UART_ISC); /* disable all interrupt */ +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + free_irq(port->irq, port); + } +@@ -372,7 +372,7 @@ static void sunplus_set_termios(struct uart_port *port, + lcr |= UART_LCR_EPAR; + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + uart_update_timeout(port, termios->c_cflag, baud); + +@@ -407,7 +407,7 @@ static void sunplus_set_termios(struct uart_port *port, + writel(div_l, port->membase + SUP_UART_DIV_L); + writel(lcr, port->membase + SUP_UART_LCR); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void sunplus_set_ldisc(struct uart_port *port, struct ktermios *termios) +@@ -517,15 +517,15 @@ static void sunplus_console_write(struct console *co, + if (sunplus_console_ports[co->index]->port.sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock(&sunplus_console_ports[co->index]->port.lock); ++ locked = uart_port_trylock(&sunplus_console_ports[co->index]->port); + else +- spin_lock(&sunplus_console_ports[co->index]->port.lock); ++ uart_port_lock(&sunplus_console_ports[co->index]->port); + + uart_console_write(&sunplus_console_ports[co->index]->port, s, count, + sunplus_uart_console_putchar); + + if (locked) +- spin_unlock(&sunplus_console_ports[co->index]->port.lock); ++ uart_port_unlock(&sunplus_console_ports[co->index]->port); + + local_irq_restore(flags); + } +diff --git a/drivers/tty/serial/sunsab.c b/drivers/tty/serial/sunsab.c +index 40eeaf835..6aa51a6f8 100644 +--- a/drivers/tty/serial/sunsab.c ++++ b/drivers/tty/serial/sunsab.c +@@ -310,7 +310,7 @@ static irqreturn_t sunsab_interrupt(int irq, void *dev_id) + unsigned long flags; + unsigned char gis; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + status.stat = 0; + gis = readb(&up->regs->r.gis) >> up->gis_shift; +@@ -331,7 +331,7 @@ static irqreturn_t sunsab_interrupt(int irq, void *dev_id) + transmit_chars(up, &status); + } + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + if (port) + tty_flip_buffer_push(port); +@@ -473,12 +473,12 @@ static void sunsab_send_xchar(struct uart_port *port, char ch) + if (ch == __DISABLED_CHAR) + return; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + sunsab_tec_wait(up); + writeb(ch, &up->regs->w.tic); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + /* port->lock held by caller. */ +@@ -499,7 +499,7 @@ static void sunsab_break_ctl(struct uart_port *port, int break_state) + unsigned long flags; + unsigned char val; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + val = up->cached_dafo; + if (break_state) +@@ -512,7 +512,7 @@ static void sunsab_break_ctl(struct uart_port *port, int break_state) + if (test_bit(SAB82532_XPR, &up->irqflags)) + sunsab_tx_idle(up); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + /* port->lock is not held. */ +@@ -527,7 +527,7 @@ static int sunsab_startup(struct uart_port *port) + if (err) + return err; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* + * Wait for any commands or immediate characters +@@ -582,7 +582,7 @@ static int sunsab_startup(struct uart_port *port) + set_bit(SAB82532_ALLS, &up->irqflags); + set_bit(SAB82532_XPR, &up->irqflags); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + return 0; + } +@@ -594,7 +594,7 @@ static void sunsab_shutdown(struct uart_port *port) + container_of(port, struct uart_sunsab_port, port); + unsigned long flags; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* Disable Interrupts */ + up->interrupt_mask0 = 0xff; +@@ -628,7 +628,7 @@ static void sunsab_shutdown(struct uart_port *port) + writeb(tmp, &up->regs->rw.ccr0); + #endif + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + free_irq(up->port.irq, up); + } + +@@ -779,9 +779,9 @@ static void sunsab_set_termios(struct uart_port *port, struct ktermios *termios, + unsigned int baud = uart_get_baud_rate(port, termios, old, 0, 4000000); + unsigned int quot = uart_get_divisor(port, baud); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + sunsab_convert_to_sab(up, termios->c_cflag, termios->c_iflag, baud, quot); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static const char *sunsab_type(struct uart_port *port) +@@ -857,15 +857,15 @@ static void sunsab_console_write(struct console *con, const char *s, unsigned n) + int locked = 1; + + if (up->port.sysrq || oops_in_progress) +- locked = spin_trylock_irqsave(&up->port.lock, flags); ++ locked = uart_port_trylock_irqsave(&up->port, &flags); + else +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + uart_console_write(&up->port, s, n, sunsab_console_putchar); + sunsab_tec_wait(up); + + if (locked) +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static int sunsab_console_setup(struct console *con, char *options) +@@ -914,7 +914,7 @@ static int sunsab_console_setup(struct console *con, char *options) + */ + sunsab_startup(&up->port); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* + * Finally, enable interrupts +@@ -932,7 +932,7 @@ static int sunsab_console_setup(struct console *con, char *options) + sunsab_convert_to_sab(up, con->cflag, 0, baud, quot); + sunsab_set_mctrl(&up->port, TIOCM_DTR | TIOCM_RTS); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + return 0; + } +diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c +index 58a4342ad..1e051cc25 100644 +--- a/drivers/tty/serial/sunsu.c ++++ b/drivers/tty/serial/sunsu.c +@@ -212,9 +212,9 @@ static void enable_rsa(struct uart_sunsu_port *up) + { + if (up->port.type == PORT_RSA) { + if (up->port.uartclk != SERIAL_RSA_BAUD_BASE * 16) { +- spin_lock_irq(&up->port.lock); ++ uart_port_lock_irq(&up->port); + __enable_rsa(up); +- spin_unlock_irq(&up->port.lock); ++ uart_port_unlock_irq(&up->port); + } + if (up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16) + serial_outp(up, UART_RSA_FRR, 0); +@@ -234,7 +234,7 @@ static void disable_rsa(struct uart_sunsu_port *up) + + if (up->port.type == PORT_RSA && + up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16) { +- spin_lock_irq(&up->port.lock); ++ uart_port_lock_irq(&up->port); + + mode = serial_inp(up, UART_RSA_MSR); + result = !(mode & UART_RSA_MSR_FIFO); +@@ -247,7 +247,7 @@ static void disable_rsa(struct uart_sunsu_port *up) + + if (result) + up->port.uartclk = SERIAL_RSA_BAUD_BASE_LO * 16; +- spin_unlock_irq(&up->port.lock); ++ uart_port_unlock_irq(&up->port); + } + } + #endif /* CONFIG_SERIAL_8250_RSA */ +@@ -311,10 +311,10 @@ static void sunsu_enable_ms(struct uart_port *port) + container_of(port, struct uart_sunsu_port, port); + unsigned long flags; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + up->ier |= UART_IER_MSI; + serial_out(up, UART_IER, up->ier); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static void +@@ -456,7 +456,7 @@ static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id) + unsigned long flags; + unsigned char status; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + do { + status = serial_inp(up, UART_LSR); +@@ -470,7 +470,7 @@ static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id) + + } while (!(serial_in(up, UART_IIR) & UART_IIR_NO_INT)); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + return IRQ_HANDLED; + } +@@ -545,9 +545,9 @@ static unsigned int sunsu_tx_empty(struct uart_port *port) + unsigned long flags; + unsigned int ret; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0; +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + return ret; + } +@@ -599,13 +599,13 @@ static void sunsu_break_ctl(struct uart_port *port, int break_state) + container_of(port, struct uart_sunsu_port, port); + unsigned long flags; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + if (break_state == -1) + up->lcr |= UART_LCR_SBC; + else + up->lcr &= ~UART_LCR_SBC; + serial_out(up, UART_LCR, up->lcr); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static int sunsu_startup(struct uart_port *port) +@@ -683,12 +683,12 @@ static int sunsu_startup(struct uart_port *port) + */ + serial_outp(up, UART_LCR, UART_LCR_WLEN8); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + up->port.mctrl |= TIOCM_OUT2; + + sunsu_set_mctrl(&up->port, up->port.mctrl); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + /* + * Finally, enable interrupts. Note: Modem status interrupts +@@ -731,7 +731,7 @@ static void sunsu_shutdown(struct uart_port *port) + up->ier = 0; + serial_outp(up, UART_IER, 0); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + if (up->port.flags & UPF_FOURPORT) { + /* reset interrupts on the AST Fourport board */ + inb((up->port.iobase & 0xfe0) | 0x1f); +@@ -740,7 +740,7 @@ static void sunsu_shutdown(struct uart_port *port) + up->port.mctrl &= ~TIOCM_OUT2; + + sunsu_set_mctrl(&up->port, up->port.mctrl); +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + /* + * Disable break condition and FIFOs +@@ -826,7 +826,7 @@ sunsu_change_speed(struct uart_port *port, unsigned int cflag, + * Ok, we're now changing the port state. Do it with + * interrupts disabled. + */ +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* + * Update the per-port timeout. +@@ -891,7 +891,7 @@ sunsu_change_speed(struct uart_port *port, unsigned int cflag, + + up->cflag = cflag; + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static void +@@ -1038,7 +1038,7 @@ static void sunsu_autoconfig(struct uart_sunsu_port *up) + up->type_probed = PORT_UNKNOWN; + up->port.iotype = UPIO_MEM; + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + if (!(up->port.flags & UPF_BUGGY_UART)) { + /* +@@ -1173,7 +1173,7 @@ static void sunsu_autoconfig(struct uart_sunsu_port *up) + serial_outp(up, UART_IER, 0); + + out: +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static struct uart_driver sunsu_reg = { +@@ -1298,9 +1298,9 @@ static void sunsu_console_write(struct console *co, const char *s, + int locked = 1; + + if (up->port.sysrq || oops_in_progress) +- locked = spin_trylock_irqsave(&up->port.lock, flags); ++ locked = uart_port_trylock_irqsave(&up->port, &flags); + else +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + /* + * First save the UER then disable the interrupts +@@ -1318,7 +1318,7 @@ static void sunsu_console_write(struct console *co, const char *s, + serial_out(up, UART_IER, ier); + + if (locked) +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + /* +diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c +index c8c71c562..d3b5e864b 100644 +--- a/drivers/tty/serial/sunzilog.c ++++ b/drivers/tty/serial/sunzilog.c +@@ -531,7 +531,7 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id) + struct tty_port *port; + unsigned char r3; + +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + r3 = read_zsreg(channel, R3); + + /* Channel A */ +@@ -548,7 +548,7 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id) + if (r3 & CHATxIP) + sunzilog_transmit_chars(up, channel); + } +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + + if (port) + tty_flip_buffer_push(port); +@@ -557,7 +557,7 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id) + up = up->next; + channel = ZILOG_CHANNEL_FROM_PORT(&up->port); + +- spin_lock(&up->port.lock); ++ uart_port_lock(&up->port); + port = NULL; + if (r3 & (CHBEXT | CHBTxIP | CHBRxIP)) { + writeb(RES_H_IUS, &channel->control); +@@ -571,7 +571,7 @@ static irqreturn_t sunzilog_interrupt(int irq, void *dev_id) + if (r3 & CHBTxIP) + sunzilog_transmit_chars(up, channel); + } +- spin_unlock(&up->port.lock); ++ uart_port_unlock(&up->port); + + if (port) + tty_flip_buffer_push(port); +@@ -604,11 +604,11 @@ static unsigned int sunzilog_tx_empty(struct uart_port *port) + unsigned char status; + unsigned int ret; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + status = sunzilog_read_channel_status(port); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (status & Tx_BUF_EMP) + ret = TIOCSER_TEMT; +@@ -764,7 +764,7 @@ static void sunzilog_break_ctl(struct uart_port *port, int break_state) + else + clear_bits |= SND_BRK; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + new_reg = (up->curregs[R5] | set_bits) & ~clear_bits; + if (new_reg != up->curregs[R5]) { +@@ -774,7 +774,7 @@ static void sunzilog_break_ctl(struct uart_port *port, int break_state) + write_zsreg(channel, R5, up->curregs[R5]); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static void __sunzilog_startup(struct uart_sunzilog_port *up) +@@ -800,9 +800,9 @@ static int sunzilog_startup(struct uart_port *port) + if (ZS_IS_CONS(up)) + return 0; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + __sunzilog_startup(up); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + return 0; + } + +@@ -840,7 +840,7 @@ static void sunzilog_shutdown(struct uart_port *port) + if (ZS_IS_CONS(up)) + return; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + channel = ZILOG_CHANNEL_FROM_PORT(port); + +@@ -853,7 +853,7 @@ static void sunzilog_shutdown(struct uart_port *port) + up->curregs[R5] &= ~SND_BRK; + sunzilog_maybe_update_regs(up, channel); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* Shared by TTY driver and serial console setup. The port lock is held +@@ -945,7 +945,7 @@ sunzilog_set_termios(struct uart_port *port, struct ktermios *termios, + + baud = uart_get_baud_rate(port, termios, old, 1200, 76800); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + brg = BPS_TO_BRG(baud, ZS_CLOCK / ZS_CLOCK_DIVISOR); + +@@ -962,7 +962,7 @@ sunzilog_set_termios(struct uart_port *port, struct ktermios *termios, + + uart_update_timeout(port, termios->c_cflag, baud); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static const char *sunzilog_type(struct uart_port *port) +@@ -1201,15 +1201,15 @@ sunzilog_console_write(struct console *con, const char *s, unsigned int count) + int locked = 1; + + if (up->port.sysrq || oops_in_progress) +- locked = spin_trylock_irqsave(&up->port.lock, flags); ++ locked = uart_port_trylock_irqsave(&up->port, &flags); + else +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + uart_console_write(&up->port, s, count, sunzilog_putchar); + udelay(2); + + if (locked) +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + } + + static int __init sunzilog_console_setup(struct console *con, char *options) +@@ -1244,7 +1244,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options) + + brg = BPS_TO_BRG(baud, ZS_CLOCK / ZS_CLOCK_DIVISOR); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + + up->curregs[R15] |= BRKIE; + sunzilog_convert_to_zs(up, con->cflag, 0, brg); +@@ -1252,7 +1252,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options) + sunzilog_set_mctrl(&up->port, TIOCM_DTR | TIOCM_RTS); + __sunzilog_startup(up); + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + return 0; + } +@@ -1333,7 +1333,7 @@ static void sunzilog_init_hw(struct uart_sunzilog_port *up) + + channel = ZILOG_CHANNEL_FROM_PORT(&up->port); + +- spin_lock_irqsave(&up->port.lock, flags); ++ uart_port_lock_irqsave(&up->port, &flags); + if (ZS_IS_CHANNEL_A(up)) { + write_zsreg(channel, R9, FHWRES); + ZSDELAY_LONG(); +@@ -1383,7 +1383,7 @@ static void sunzilog_init_hw(struct uart_sunzilog_port *up) + write_zsreg(channel, R9, up->curregs[R9]); + } + +- spin_unlock_irqrestore(&up->port.lock, flags); ++ uart_port_unlock_irqrestore(&up->port, flags); + + #ifdef CONFIG_SERIO + if (up->flags & (SUNZILOG_FLAG_CONS_KEYB | +diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c +index 0859394a7..0cc6524f5 100644 +--- a/drivers/tty/serial/timbuart.c ++++ b/drivers/tty/serial/timbuart.c +@@ -174,7 +174,7 @@ static void timbuart_tasklet(struct tasklet_struct *t) + struct timbuart_port *uart = from_tasklet(uart, t, tasklet); + u32 isr, ier = 0; + +- spin_lock(&uart->port.lock); ++ uart_port_lock(&uart->port); + + isr = ioread32(uart->port.membase + TIMBUART_ISR); + dev_dbg(uart->port.dev, "%s ISR: %x\n", __func__, isr); +@@ -189,7 +189,7 @@ static void timbuart_tasklet(struct tasklet_struct *t) + + iowrite32(ier, uart->port.membase + TIMBUART_IER); + +- spin_unlock(&uart->port.lock); ++ uart_port_unlock(&uart->port); + dev_dbg(uart->port.dev, "%s leaving\n", __func__); + } + +@@ -295,10 +295,10 @@ static void timbuart_set_termios(struct uart_port *port, + tty_termios_copy_hw(termios, old); + tty_termios_encode_baud_rate(termios, baud, baud); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + iowrite8((u8)bindex, port->membase + TIMBUART_BAUDRATE); + uart_update_timeout(port, termios->c_cflag, baud); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *timbuart_type(struct uart_port *port) +diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c +index b225a78f6..404c14aca 100644 +--- a/drivers/tty/serial/uartlite.c ++++ b/drivers/tty/serial/uartlite.c +@@ -216,11 +216,11 @@ static irqreturn_t ulite_isr(int irq, void *dev_id) + unsigned long flags; + + do { +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + stat = uart_in32(ULITE_STATUS, port); + busy = ulite_receive(port, stat); + busy |= ulite_transmit(port, stat); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + n++; + } while (busy); + +@@ -238,9 +238,9 @@ static unsigned int ulite_tx_empty(struct uart_port *port) + unsigned long flags; + unsigned int ret; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + ret = uart_in32(ULITE_STATUS, port); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return ret & ULITE_STATUS_TXEMPTY ? TIOCSER_TEMT : 0; + } +@@ -323,7 +323,7 @@ static void ulite_set_termios(struct uart_port *port, + termios->c_cflag |= pdata->cflags & (PARENB | PARODD | CSIZE); + tty_termios_encode_baud_rate(termios, pdata->baud, pdata->baud); + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + port->read_status_mask = ULITE_STATUS_RXVALID | ULITE_STATUS_OVERRUN + | ULITE_STATUS_TXFULL; +@@ -346,7 +346,7 @@ static void ulite_set_termios(struct uart_port *port, + /* update timeout */ + uart_update_timeout(port, termios->c_cflag, pdata->baud); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *ulite_type(struct uart_port *port) +@@ -495,9 +495,9 @@ static void ulite_console_write(struct console *co, const char *s, + int locked = 1; + + if (oops_in_progress) { +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + } else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* save and disable interrupt */ + ier = uart_in32(ULITE_STATUS, port) & ULITE_STATUS_IE; +@@ -512,7 +512,7 @@ static void ulite_console_write(struct console *co, const char *s, + uart_out32(ULITE_CONTROL_IE, ULITE_CONTROL, port); + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static int ulite_console_setup(struct console *co, char *options) +diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c +index b06661b80..ed7a6bb55 100644 +--- a/drivers/tty/serial/ucc_uart.c ++++ b/drivers/tty/serial/ucc_uart.c +@@ -931,7 +931,7 @@ static void qe_uart_set_termios(struct uart_port *port, + baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); + + /* Do we really need a spinlock here? */ +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Update the per-port timeout. */ + uart_update_timeout(port, termios->c_cflag, baud); +@@ -949,7 +949,7 @@ static void qe_uart_set_termios(struct uart_port *port, + qe_setbrg(qe_port->us_info.tx_clock, baud, 16); + } + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* +diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c +index c5d5c2765..78a1c1eea 100644 +--- a/drivers/tty/serial/vt8500_serial.c ++++ b/drivers/tty/serial/vt8500_serial.c +@@ -227,7 +227,7 @@ static irqreturn_t vt8500_irq(int irq, void *dev_id) + struct uart_port *port = dev_id; + unsigned long isr; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + isr = vt8500_read(port, VT8500_URISR); + + /* Acknowledge active status bits */ +@@ -240,7 +240,7 @@ static irqreturn_t vt8500_irq(int irq, void *dev_id) + if (isr & TCTS) + handle_delta_cts(port); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + return IRQ_HANDLED; + } +@@ -342,7 +342,7 @@ static void vt8500_set_termios(struct uart_port *port, + unsigned int baud, lcr; + unsigned int loops = 1000; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* calculate and set baud rate */ + baud = uart_get_baud_rate(port, termios, old, 900, 921600); +@@ -410,7 +410,7 @@ static void vt8500_set_termios(struct uart_port *port, + vt8500_write(&vt8500_port->uart, 0x881, VT8500_URFCR); + vt8500_write(&vt8500_port->uart, vt8500_port->ier, VT8500_URIER); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + static const char *vt8500_type(struct uart_port *port) +diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c +index 2e5e86a00..9c13dac1d 100644 +--- a/drivers/tty/serial/xilinx_uartps.c ++++ b/drivers/tty/serial/xilinx_uartps.c +@@ -346,7 +346,7 @@ static irqreturn_t cdns_uart_isr(int irq, void *dev_id) + struct uart_port *port = (struct uart_port *)dev_id; + unsigned int isrstatus; + +- spin_lock(&port->lock); ++ uart_port_lock(port); + + /* Read the interrupt status register to determine which + * interrupt(s) is/are active and clear them. +@@ -369,7 +369,7 @@ static irqreturn_t cdns_uart_isr(int irq, void *dev_id) + !(readl(port->membase + CDNS_UART_CR) & CDNS_UART_CR_RX_DIS)) + cdns_uart_handle_rx(dev_id, isrstatus); + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + return IRQ_HANDLED; + } + +@@ -506,14 +506,14 @@ static int cdns_uart_clk_notifier_cb(struct notifier_block *nb, + return NOTIFY_BAD; + } + +- spin_lock_irqsave(&cdns_uart->port->lock, flags); ++ uart_port_lock_irqsave(cdns_uart->port, &flags); + + /* Disable the TX and RX to set baud rate */ + ctrl_reg = readl(port->membase + CDNS_UART_CR); + ctrl_reg |= CDNS_UART_CR_TX_DIS | CDNS_UART_CR_RX_DIS; + writel(ctrl_reg, port->membase + CDNS_UART_CR); + +- spin_unlock_irqrestore(&cdns_uart->port->lock, flags); ++ uart_port_unlock_irqrestore(cdns_uart->port, flags); + + return NOTIFY_OK; + } +@@ -523,7 +523,7 @@ static int cdns_uart_clk_notifier_cb(struct notifier_block *nb, + * frequency. + */ + +- spin_lock_irqsave(&cdns_uart->port->lock, flags); ++ uart_port_lock_irqsave(cdns_uart->port, &flags); + + locked = 1; + port->uartclk = ndata->new_rate; +@@ -533,7 +533,7 @@ static int cdns_uart_clk_notifier_cb(struct notifier_block *nb, + fallthrough; + case ABORT_RATE_CHANGE: + if (!locked) +- spin_lock_irqsave(&cdns_uart->port->lock, flags); ++ uart_port_lock_irqsave(cdns_uart->port, &flags); + + /* Set TX/RX Reset */ + ctrl_reg = readl(port->membase + CDNS_UART_CR); +@@ -555,7 +555,7 @@ static int cdns_uart_clk_notifier_cb(struct notifier_block *nb, + ctrl_reg |= CDNS_UART_CR_TX_EN | CDNS_UART_CR_RX_EN; + writel(ctrl_reg, port->membase + CDNS_UART_CR); + +- spin_unlock_irqrestore(&cdns_uart->port->lock, flags); ++ uart_port_unlock_irqrestore(cdns_uart->port, flags); + + return NOTIFY_OK; + default: +@@ -652,7 +652,7 @@ static void cdns_uart_break_ctl(struct uart_port *port, int ctl) + unsigned int status; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + status = readl(port->membase + CDNS_UART_CR); + +@@ -664,7 +664,7 @@ static void cdns_uart_break_ctl(struct uart_port *port, int ctl) + writel(CDNS_UART_CR_STOPBRK | status, + port->membase + CDNS_UART_CR); + } +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /** +@@ -683,7 +683,7 @@ static void cdns_uart_set_termios(struct uart_port *port, + unsigned long flags; + unsigned int ctrl_reg, mode_reg; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Disable the TX and RX to set baud rate */ + ctrl_reg = readl(port->membase + CDNS_UART_CR); +@@ -794,7 +794,7 @@ static void cdns_uart_set_termios(struct uart_port *port, + cval &= ~CDNS_UART_MODEMCR_FCM; + writel(cval, port->membase + CDNS_UART_MODEMCR); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /** +@@ -813,7 +813,7 @@ static int cdns_uart_startup(struct uart_port *port) + + is_brk_support = cdns_uart->quirks & CDNS_UART_RXBS_SUPPORT; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Disable the TX and RX */ + writel(CDNS_UART_CR_TX_DIS | CDNS_UART_CR_RX_DIS, +@@ -861,7 +861,7 @@ static int cdns_uart_startup(struct uart_port *port) + writel(readl(port->membase + CDNS_UART_ISR), + port->membase + CDNS_UART_ISR); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + ret = request_irq(port->irq, cdns_uart_isr, 0, CDNS_UART_NAME, port); + if (ret) { +@@ -889,7 +889,7 @@ static void cdns_uart_shutdown(struct uart_port *port) + int status; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Disable interrupts */ + status = readl(port->membase + CDNS_UART_IMR); +@@ -900,7 +900,7 @@ static void cdns_uart_shutdown(struct uart_port *port) + writel(CDNS_UART_CR_TX_DIS | CDNS_UART_CR_RX_DIS, + port->membase + CDNS_UART_CR); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + free_irq(port->irq, port); + } +@@ -1050,7 +1050,7 @@ static int cdns_uart_poll_get_char(struct uart_port *port) + int c; + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Check if FIFO is empty */ + if (readl(port->membase + CDNS_UART_SR) & CDNS_UART_SR_RXEMPTY) +@@ -1058,7 +1058,7 @@ static int cdns_uart_poll_get_char(struct uart_port *port) + else /* Read a character */ + c = (unsigned char) readl(port->membase + CDNS_UART_FIFO); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + return c; + } +@@ -1067,7 +1067,7 @@ static void cdns_uart_poll_put_char(struct uart_port *port, unsigned char c) + { + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Wait until FIFO is empty */ + while (!(readl(port->membase + CDNS_UART_SR) & CDNS_UART_SR_TXEMPTY)) +@@ -1080,7 +1080,7 @@ static void cdns_uart_poll_put_char(struct uart_port *port, unsigned char c) + while (!(readl(port->membase + CDNS_UART_SR) & CDNS_UART_SR_TXEMPTY)) + cpu_relax(); + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + #endif + +@@ -1232,9 +1232,9 @@ static void cdns_uart_console_write(struct console *co, const char *s, + if (port->sysrq) + locked = 0; + else if (oops_in_progress) +- locked = spin_trylock_irqsave(&port->lock, flags); ++ locked = uart_port_trylock_irqsave(port, &flags); + else +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* save and disable interrupt */ + imr = readl(port->membase + CDNS_UART_IMR); +@@ -1257,7 +1257,7 @@ static void cdns_uart_console_write(struct console *co, const char *s, + writel(imr, port->membase + CDNS_UART_IER); + + if (locked) +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /** +@@ -1325,7 +1325,7 @@ static int cdns_uart_suspend(struct device *device) + if (console_suspend_enabled && uart_console(port) && may_wake) { + unsigned long flags; + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + /* Empty the receive FIFO 1st before making changes */ + while (!(readl(port->membase + CDNS_UART_SR) & + CDNS_UART_SR_RXEMPTY)) +@@ -1334,7 +1334,7 @@ static int cdns_uart_suspend(struct device *device) + writel(1, port->membase + CDNS_UART_RXWM); + /* disable RX timeout interrups */ + writel(CDNS_UART_IXR_TOUT, port->membase + CDNS_UART_IDR); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + /* +@@ -1372,7 +1372,7 @@ static int cdns_uart_resume(struct device *device) + return ret; + } + +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + + /* Set TX/RX Reset */ + ctrl_reg = readl(port->membase + CDNS_UART_CR); +@@ -1392,14 +1392,14 @@ static int cdns_uart_resume(struct device *device) + + clk_disable(cdns_uart->uartclk); + clk_disable(cdns_uart->pclk); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } else { +- spin_lock_irqsave(&port->lock, flags); ++ uart_port_lock_irqsave(port, &flags); + /* restore original rx trigger level */ + writel(rx_trigger_level, port->membase + CDNS_UART_RXWM); + /* enable RX timeout interrupt */ + writel(CDNS_UART_IXR_TOUT, port->membase + CDNS_UART_IER); +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + + return uart_resume_port(cdns_uart->cdns_uart_driver, port); +diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c +index 493fc4742..afa52883c 100644 +--- a/drivers/tty/tty_io.c ++++ b/drivers/tty/tty_io.c +@@ -3543,8 +3543,15 @@ static ssize_t show_cons_active(struct device *dev, + for_each_console(c) { + if (!c->device) + continue; +- if (!c->write) +- continue; ++ if (c->flags & CON_NBCON) { ++ if (!c->write_atomic && ++ !(c->write_thread && c->kthread)) { ++ continue; ++ } ++ } else { ++ if (!c->write) ++ continue; ++ } + if ((c->flags & CON_ENABLED) == 0) + continue; + cs[i++] = c; +diff --git a/fs/proc/consoles.c b/fs/proc/consoles.c +index e0758fe79..270367654 100644 +--- a/fs/proc/consoles.c ++++ b/fs/proc/consoles.c +@@ -21,12 +21,14 @@ static int show_console_dev(struct seq_file *m, void *v) + { CON_ENABLED, 'E' }, + { CON_CONSDEV, 'C' }, + { CON_BOOT, 'B' }, ++ { CON_NBCON, 'N' }, + { CON_PRINTBUFFER, 'p' }, + { CON_BRL, 'b' }, + { CON_ANYTIME, 'a' }, + }; + char flags[ARRAY_SIZE(con_flags) + 1]; + struct console *con = v; ++ char con_write = '-'; + unsigned int a; + dev_t dev = 0; + +@@ -57,9 +59,15 @@ static int show_console_dev(struct seq_file *m, void *v) + seq_setwidth(m, 21 - 1); + seq_printf(m, "%s%d", con->name, con->index); + seq_pad(m, ' '); +- seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-', +- con->write ? 'W' : '-', con->unblank ? 'U' : '-', +- flags); ++ if (con->flags & CON_NBCON) { ++ if (con->write_atomic || con->write_thread) ++ con_write = 'W'; ++ } else { ++ if (con->write) ++ con_write = 'W'; ++ } ++ seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-', con_write, ++ con->unblank ? 'U' : '-', flags); + if (dev) + seq_printf(m, " %4d:%d", MAJOR(dev), MINOR(dev)); + +diff --git a/include/linux/bottom_half.h b/include/linux/bottom_half.h +index fc53e0ad5..448bbef47 100644 +--- a/include/linux/bottom_half.h ++++ b/include/linux/bottom_half.h +@@ -35,8 +35,10 @@ static inline void local_bh_enable(void) + + #ifdef CONFIG_PREEMPT_RT + extern bool local_bh_blocked(void); ++extern void softirq_preempt(void); + #else + static inline bool local_bh_blocked(void) { return false; } ++static inline void softirq_preempt(void) { } + #endif + + #endif /* _LINUX_BH_H */ +diff --git a/include/linux/console.h b/include/linux/console.h +index 7de11c763..f8a062867 100644 +--- a/include/linux/console.h ++++ b/include/linux/console.h +@@ -16,7 +16,9 @@ + + #include + #include ++#include + #include ++#include + #include + + struct vc_data; +@@ -156,6 +158,8 @@ static inline int con_debug_leave(void) + * /dev/kmesg which requires a larger output buffer. + * @CON_SUSPENDED: Indicates if a console is suspended. If true, the + * printing callbacks must not be called. ++ * @CON_NBCON: Console can operate outside of the legacy style console_lock ++ * constraints. + */ + enum cons_flags { + CON_PRINTBUFFER = BIT(0), +@@ -166,6 +170,111 @@ enum cons_flags { + CON_BRL = BIT(5), + CON_EXTENDED = BIT(6), + CON_SUSPENDED = BIT(7), ++ CON_NBCON = BIT(8), ++}; ++ ++/** ++ * struct nbcon_state - console state for nbcon consoles ++ * @atom: Compound of the state fields for atomic operations ++ * ++ * @req_prio: The priority of a handover request ++ * @prio: The priority of the current owner ++ * @unsafe: Console is busy in a non takeover region ++ * @unsafe_takeover: A hostile takeover in an unsafe state happened in the ++ * past. The console cannot be safe until re-initialized. ++ * @cpu: The CPU on which the owner runs ++ * ++ * To be used for reading and preparing of the value stored in the nbcon ++ * state variable @console::nbcon_state. ++ * ++ * The @prio and @req_prio fields are particularly important to allow ++ * spin-waiting to timeout and give up without the risk of a waiter being ++ * assigned the lock after giving up. ++ */ ++struct nbcon_state { ++ union { ++ unsigned int atom; ++ struct { ++ unsigned int prio : 2; ++ unsigned int req_prio : 2; ++ unsigned int unsafe : 1; ++ unsigned int unsafe_takeover : 1; ++ unsigned int cpu : 24; ++ }; ++ }; ++}; ++ ++/* ++ * The nbcon_state struct is used to easily create and interpret values that ++ * are stored in the @console::nbcon_state variable. Ensure this struct stays ++ * within the size boundaries of the atomic variable's underlying type in ++ * order to avoid any accidental truncation. ++ */ ++static_assert(sizeof(struct nbcon_state) <= sizeof(int)); ++ ++/** ++ * nbcon_prio - console owner priority for nbcon consoles ++ * @NBCON_PRIO_NONE: Unused ++ * @NBCON_PRIO_NORMAL: Normal (non-emergency) usage ++ * @NBCON_PRIO_EMERGENCY: Emergency output (WARN/OOPS...) ++ * @NBCON_PRIO_PANIC: Panic output ++ * @NBCON_PRIO_MAX: The number of priority levels ++ * ++ * A higher priority context can takeover the console when it is ++ * in the safe state. The final attempt to flush consoles in panic() ++ * can be allowed to do so even in an unsafe state (Hope and pray). ++ */ ++enum nbcon_prio { ++ NBCON_PRIO_NONE = 0, ++ NBCON_PRIO_NORMAL, ++ NBCON_PRIO_EMERGENCY, ++ NBCON_PRIO_PANIC, ++ NBCON_PRIO_MAX, ++}; ++ ++struct console; ++struct printk_buffers; ++ ++/** ++ * struct nbcon_context - Context for console acquire/release ++ * @console: The associated console ++ * @spinwait_max_us: Limit for spin-wait acquire ++ * @prio: Priority of the context ++ * @allow_unsafe_takeover: Allow performing takeover even if unsafe. Can ++ * be used only with NBCON_PRIO_PANIC @prio. It ++ * might cause a system freeze when the console ++ * is used later. ++ * @backlog: Ringbuffer has pending records ++ * @pbufs: Pointer to the text buffer for this context ++ * @seq: The sequence number to print for this context ++ */ ++struct nbcon_context { ++ /* members set by caller */ ++ struct console *console; ++ unsigned int spinwait_max_us; ++ enum nbcon_prio prio; ++ unsigned int allow_unsafe_takeover : 1; ++ ++ /* members set by emit */ ++ unsigned int backlog : 1; ++ ++ /* members set by acquire */ ++ struct printk_buffers *pbufs; ++ u64 seq; ++}; ++ ++/** ++ * struct nbcon_write_context - Context handed to the nbcon write callbacks ++ * @ctxt: The core console context ++ * @outbuf: Pointer to the text buffer for output ++ * @len: Length to write ++ * @unsafe_takeover: If a hostile takeover in an unsafe state has occurred ++ */ ++struct nbcon_write_context { ++ struct nbcon_context __private ctxt; ++ char *outbuf; ++ unsigned int len; ++ bool unsafe_takeover; + }; + + /** +@@ -187,6 +296,18 @@ enum cons_flags { + * @dropped: Number of unreported dropped ringbuffer records + * @data: Driver private data + * @node: hlist node for the console list ++ * ++ * @write_atomic: Write callback for atomic context ++ * @write_thread: Write callback for non-atomic context ++ * @driver_enter: Callback to begin synchronization with driver code ++ * @driver_exit: Callback to finish synchronization with driver code ++ * @nbcon_state: State for nbcon consoles ++ * @nbcon_seq: Sequence number of the next record for nbcon to print ++ * @pbufs: Pointer to nbcon private buffer ++ * @locked_port: True, if the port lock is locked by nbcon ++ * @kthread: Printer kthread for this console ++ * @rcuwait: RCU-safe wait object for @kthread waking ++ * @irq_work: Defer @kthread waking to IRQ work context + */ + struct console { + char name[16]; +@@ -206,6 +327,21 @@ struct console { + unsigned long dropped; + void *data; + struct hlist_node node; ++ ++ /* nbcon console specific members */ ++ bool (*write_atomic)(struct console *con, ++ struct nbcon_write_context *wctxt); ++ bool (*write_thread)(struct console *con, ++ struct nbcon_write_context *wctxt); ++ void (*driver_enter)(struct console *con, unsigned long *flags); ++ void (*driver_exit)(struct console *con, unsigned long flags); ++ atomic_t __private nbcon_state; ++ atomic_long_t __private nbcon_seq; ++ struct printk_buffers *pbufs; ++ bool locked_port; ++ struct task_struct *kthread; ++ struct rcuwait rcuwait; ++ struct irq_work irq_work; + }; + + #ifdef CONFIG_LOCKDEP +@@ -332,6 +468,22 @@ static inline bool console_is_registered(const struct console *con) + lockdep_assert_console_list_lock_held(); \ + hlist_for_each_entry(con, &console_list, node) + ++#ifdef CONFIG_PRINTK ++extern void nbcon_cpu_emergency_enter(void); ++extern void nbcon_cpu_emergency_exit(void); ++extern bool nbcon_can_proceed(struct nbcon_write_context *wctxt); ++extern bool nbcon_enter_unsafe(struct nbcon_write_context *wctxt); ++extern bool nbcon_exit_unsafe(struct nbcon_write_context *wctxt); ++extern void nbcon_reacquire(struct nbcon_write_context *wctxt); ++#else ++static inline void nbcon_cpu_emergency_enter(void) { } ++static inline void nbcon_cpu_emergency_exit(void) { } ++static inline bool nbcon_can_proceed(struct nbcon_write_context *wctxt) { return false; } ++static inline bool nbcon_enter_unsafe(struct nbcon_write_context *wctxt) { return false; } ++static inline bool nbcon_exit_unsafe(struct nbcon_write_context *wctxt) { return false; } ++static inline void nbcon_reacquire(struct nbcon_write_context *wctxt) { } ++#endif ++ + extern int console_set_on_cmdline; + extern struct console *early_console; + +diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h +index d95ab85f9..8b3ab0cc1 100644 +--- a/include/linux/entry-common.h ++++ b/include/linux/entry-common.h +@@ -60,7 +60,7 @@ + #define EXIT_TO_USER_MODE_WORK \ + (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_UPROBE | \ + _TIF_NEED_RESCHED | _TIF_PATCH_PENDING | _TIF_NOTIFY_SIGNAL | \ +- ARCH_EXIT_TO_USER_MODE_WORK) ++ _TIF_NEED_RESCHED_LAZY | ARCH_EXIT_TO_USER_MODE_WORK) + + /** + * arch_enter_from_user_mode - Architecture specific sanity check for user mode regs +diff --git a/include/linux/entry-kvm.h b/include/linux/entry-kvm.h +index 6813171af..674a622c9 100644 +--- a/include/linux/entry-kvm.h ++++ b/include/linux/entry-kvm.h +@@ -18,7 +18,7 @@ + + #define XFER_TO_GUEST_MODE_WORK \ + (_TIF_NEED_RESCHED | _TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL | \ +- _TIF_NOTIFY_RESUME | ARCH_XFER_TO_GUEST_MODE_WORK) ++ _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED_LAZY | ARCH_XFER_TO_GUEST_MODE_WORK) + + struct kvm_vcpu; + +diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h +index 9aac2ab15..6b9c8a16e 100644 +--- a/include/linux/interrupt.h ++++ b/include/linux/interrupt.h +@@ -613,6 +613,35 @@ extern void __raise_softirq_irqoff(unsigned int nr); + extern void raise_softirq_irqoff(unsigned int nr); + extern void raise_softirq(unsigned int nr); + ++#ifdef CONFIG_PREEMPT_RT ++DECLARE_PER_CPU(struct task_struct *, timersd); ++DECLARE_PER_CPU(unsigned long, pending_timer_softirq); ++ ++extern void raise_timer_softirq(void); ++extern void raise_hrtimer_softirq(void); ++ ++static inline unsigned int local_pending_timers(void) ++{ ++ return __this_cpu_read(pending_timer_softirq); ++} ++ ++#else ++static inline void raise_timer_softirq(void) ++{ ++ raise_softirq(TIMER_SOFTIRQ); ++} ++ ++static inline void raise_hrtimer_softirq(void) ++{ ++ raise_softirq_irqoff(HRTIMER_SOFTIRQ); ++} ++ ++static inline unsigned int local_pending_timers(void) ++{ ++ return local_softirq_pending(); ++} ++#endif ++ + DECLARE_PER_CPU(struct task_struct *, ksoftirqd); + + static inline struct task_struct *this_cpu_ksoftirqd(void) +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h +index fc25776ea..48707941d 100644 +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -3300,7 +3300,11 @@ struct softnet_data { + int defer_count; + int defer_ipi_scheduled; + struct sk_buff *defer_list; ++#ifndef CONFIG_PREEMPT_RT + call_single_data_t defer_csd; ++#else ++ struct work_struct defer_work; ++#endif + }; + + static inline void input_queue_head_incr(struct softnet_data *sd) +diff --git a/include/linux/preempt.h b/include/linux/preempt.h +index 9aa6358a1..cd16f0330 100644 +--- a/include/linux/preempt.h ++++ b/include/linux/preempt.h +@@ -230,15 +230,21 @@ do { \ + #define preempt_enable() \ + do { \ + barrier(); \ +- if (unlikely(preempt_count_dec_and_test())) \ ++ if (unlikely(preempt_count_dec_and_test())) { \ ++ instrumentation_begin(); \ + __preempt_schedule(); \ ++ instrumentation_end(); \ ++ } \ + } while (0) + + #define preempt_enable_notrace() \ + do { \ + barrier(); \ +- if (unlikely(__preempt_count_dec_and_test())) \ ++ if (unlikely(__preempt_count_dec_and_test())) { \ ++ instrumentation_begin(); \ + __preempt_schedule_notrace(); \ ++ instrumentation_end(); \ ++ } \ + } while (0) + + #define preempt_check_resched() \ +diff --git a/include/linux/printk.h b/include/linux/printk.h +index 8ef499ab3..7a942e987 100644 +--- a/include/linux/printk.h ++++ b/include/linux/printk.h +@@ -9,6 +9,8 @@ + #include + #include + ++struct uart_port; ++ + extern const char linux_banner[]; + extern const char linux_proc_banner[]; + +@@ -159,13 +161,16 @@ __printf(1, 2) __cold int _printk_deferred(const char *fmt, ...); + + extern void __printk_safe_enter(void); + extern void __printk_safe_exit(void); ++extern void __printk_deferred_enter(void); ++extern void __printk_deferred_exit(void); ++ + /* + * The printk_deferred_enter/exit macros are available only as a hack for + * some code paths that need to defer all printk console printing. Interrupts + * must be disabled for the deferred duration. + */ +-#define printk_deferred_enter __printk_safe_enter +-#define printk_deferred_exit __printk_safe_exit ++#define printk_deferred_enter() __printk_deferred_enter() ++#define printk_deferred_exit() __printk_deferred_exit() + + /* + * Please don't use printk_ratelimit(), because it shares ratelimiting state +@@ -192,6 +197,10 @@ void show_regs_print_info(const char *log_lvl); + extern asmlinkage void dump_stack_lvl(const char *log_lvl) __cold; + extern asmlinkage void dump_stack(void) __cold; + void printk_trigger_flush(void); ++void printk_legacy_allow_panic_sync(void); ++extern void nbcon_acquire(struct uart_port *up); ++extern void nbcon_release(struct uart_port *up); ++void nbcon_atomic_flush_unsafe(void); + #else + static inline __printf(1, 0) + int vprintk(const char *s, va_list args) +@@ -271,6 +280,23 @@ static inline void dump_stack(void) + static inline void printk_trigger_flush(void) + { + } ++ ++static inline void printk_legacy_allow_panic_sync(void) ++{ ++} ++ ++static inline void nbcon_acquire(struct uart_port *up) ++{ ++} ++ ++static inline void nbcon_release(struct uart_port *up) ++{ ++} ++ ++static inline void nbcon_atomic_flush_unsafe(void) ++{ ++} ++ + #endif + + #ifdef CONFIG_SMP +diff --git a/include/linux/sched.h b/include/linux/sched.h +index b65d74c5e..d5fba1473 100644 +--- a/include/linux/sched.h ++++ b/include/linux/sched.h +@@ -944,6 +944,9 @@ struct task_struct { + * ->sched_remote_wakeup gets used, so it can be in this word. + */ + unsigned sched_remote_wakeup:1; ++#ifdef CONFIG_RT_MUTEXES ++ unsigned sched_rt_mutex:1; ++#endif + + /* Bit to tell LSMs we're in execve(): */ + unsigned in_execve:1; +@@ -1979,6 +1982,7 @@ static inline int dl_task_check_affinity(struct task_struct *p, const struct cpu + } + #endif + ++extern bool task_is_pi_boosted(const struct task_struct *p); + extern int yield_to(struct task_struct *p, bool preempt); + extern void set_user_nice(struct task_struct *p, long nice); + extern int task_prio(const struct task_struct *p); +@@ -2130,17 +2134,17 @@ static inline void update_tsk_thread_flag(struct task_struct *tsk, int flag, + update_ti_thread_flag(task_thread_info(tsk), flag, value); + } + +-static inline int test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) ++static inline bool test_and_set_tsk_thread_flag(struct task_struct *tsk, int flag) + { + return test_and_set_ti_thread_flag(task_thread_info(tsk), flag); + } + +-static inline int test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) ++static inline bool test_and_clear_tsk_thread_flag(struct task_struct *tsk, int flag) + { + return test_and_clear_ti_thread_flag(task_thread_info(tsk), flag); + } + +-static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) ++static inline bool test_tsk_thread_flag(struct task_struct *tsk, int flag) + { + return test_ti_thread_flag(task_thread_info(tsk), flag); + } +@@ -2153,9 +2157,11 @@ static inline void set_tsk_need_resched(struct task_struct *tsk) + static inline void clear_tsk_need_resched(struct task_struct *tsk) + { + clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED); ++ if (IS_ENABLED(CONFIG_PREEMPT_BUILD_AUTO)) ++ clear_tsk_thread_flag(tsk, TIF_NEED_RESCHED_LAZY); + } + +-static inline int test_tsk_need_resched(struct task_struct *tsk) ++static inline bool test_tsk_need_resched(struct task_struct *tsk) + { + return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); + } +@@ -2336,7 +2342,7 @@ static inline int rwlock_needbreak(rwlock_t *lock) + + static __always_inline bool need_resched(void) + { +- return unlikely(tif_need_resched()); ++ return unlikely(tif_need_resched_lazy() || tif_need_resched()); + } + + /* +diff --git a/include/linux/sched/idle.h b/include/linux/sched/idle.h +index 478084f91..719416fe8 100644 +--- a/include/linux/sched/idle.h ++++ b/include/linux/sched/idle.h +@@ -63,7 +63,7 @@ static __always_inline bool __must_check current_set_polling_and_test(void) + */ + smp_mb__after_atomic(); + +- return unlikely(tif_need_resched()); ++ return unlikely(need_resched()); + } + + static __always_inline bool __must_check current_clr_polling_and_test(void) +@@ -76,7 +76,7 @@ static __always_inline bool __must_check current_clr_polling_and_test(void) + */ + smp_mb__after_atomic(); + +- return unlikely(tif_need_resched()); ++ return unlikely(need_resched()); + } + + #else +@@ -85,11 +85,11 @@ static inline void __current_clr_polling(void) { } + + static inline bool __must_check current_set_polling_and_test(void) + { +- return unlikely(tif_need_resched()); ++ return unlikely(need_resched()); + } + static inline bool __must_check current_clr_polling_and_test(void) + { +- return unlikely(tif_need_resched()); ++ return unlikely(need_resched()); + } + #endif + +diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h +index 994c25640..b2b9e6eb9 100644 +--- a/include/linux/sched/rt.h ++++ b/include/linux/sched/rt.h +@@ -30,6 +30,10 @@ static inline bool task_is_realtime(struct task_struct *tsk) + } + + #ifdef CONFIG_RT_MUTEXES ++extern void rt_mutex_pre_schedule(void); ++extern void rt_mutex_schedule(void); ++extern void rt_mutex_post_schedule(void); ++ + /* + * Must hold either p->pi_lock or task_rq(p)->lock. + */ +diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h +index be65de65f..ec46e3b49 100644 +--- a/include/linux/serial_8250.h ++++ b/include/linux/serial_8250.h +@@ -153,6 +153,8 @@ struct uart_8250_port { + #define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA + unsigned char msr_saved_flags; + ++ bool console_newline_needed; ++ + struct uart_8250_dma *dma; + const struct uart_8250_ops *ops; + +@@ -204,6 +206,10 @@ void serial8250_init_port(struct uart_8250_port *up); + void serial8250_set_defaults(struct uart_8250_port *up); + void serial8250_console_write(struct uart_8250_port *up, const char *s, + unsigned int count); ++bool serial8250_console_write_atomic(struct uart_8250_port *up, ++ struct nbcon_write_context *wctxt); ++bool serial8250_console_write_thread(struct uart_8250_port *up, ++ struct nbcon_write_context *wctxt); + int serial8250_console_setup(struct uart_port *port, char *options, bool probe); + int serial8250_console_exit(struct uart_port *port); + +diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h +index a7d5fa892..81bbd8761 100644 +--- a/include/linux/serial_core.h ++++ b/include/linux/serial_core.h +@@ -595,6 +595,7 @@ struct uart_port { + static inline void uart_port_lock(struct uart_port *up) + { + spin_lock(&up->lock); ++ nbcon_acquire(up); + } + + /** +@@ -604,6 +605,7 @@ static inline void uart_port_lock(struct uart_port *up) + static inline void uart_port_lock_irq(struct uart_port *up) + { + spin_lock_irq(&up->lock); ++ nbcon_acquire(up); + } + + /** +@@ -614,6 +616,7 @@ static inline void uart_port_lock_irq(struct uart_port *up) + static inline void uart_port_lock_irqsave(struct uart_port *up, unsigned long *flags) + { + spin_lock_irqsave(&up->lock, *flags); ++ nbcon_acquire(up); + } + + /** +@@ -624,7 +627,11 @@ static inline void uart_port_lock_irqsave(struct uart_port *up, unsigned long *f + */ + static inline bool uart_port_trylock(struct uart_port *up) + { +- return spin_trylock(&up->lock); ++ if (!spin_trylock(&up->lock)) ++ return false; ++ ++ nbcon_acquire(up); ++ return true; + } + + /** +@@ -636,7 +643,11 @@ static inline bool uart_port_trylock(struct uart_port *up) + */ + static inline bool uart_port_trylock_irqsave(struct uart_port *up, unsigned long *flags) + { +- return spin_trylock_irqsave(&up->lock, *flags); ++ if (!spin_trylock_irqsave(&up->lock, *flags)) ++ return false; ++ ++ nbcon_acquire(up); ++ return true; + } + + /** +@@ -645,6 +656,7 @@ static inline bool uart_port_trylock_irqsave(struct uart_port *up, unsigned long + */ + static inline void uart_port_unlock(struct uart_port *up) + { ++ nbcon_release(up); + spin_unlock(&up->lock); + } + +@@ -654,6 +666,7 @@ static inline void uart_port_unlock(struct uart_port *up) + */ + static inline void uart_port_unlock_irq(struct uart_port *up) + { ++ nbcon_release(up); + spin_unlock_irq(&up->lock); + } + +@@ -664,9 +677,24 @@ static inline void uart_port_unlock_irq(struct uart_port *up) + */ + static inline void uart_port_unlock_irqrestore(struct uart_port *up, unsigned long flags) + { ++ nbcon_release(up); + spin_unlock_irqrestore(&up->lock, flags); + } + ++/* Only for use in the console->driver_enter() callback. */ ++static inline void __uart_port_lock_irqsave(struct uart_port *up, unsigned long *flags) ++{ ++ nbcon_release(up); ++ spin_lock_irqsave(&up->lock, *flags); ++} ++ ++/* Only for use in the console->driver_exit() callback. */ ++static inline void __uart_port_unlock_irqrestore(struct uart_port *up, unsigned long flags) ++{ ++ spin_unlock_irqrestore(&up->lock, flags); ++} ++ ++ + static inline int serial_port_in(struct uart_port *up, int offset) + { + return up->serial_in(up, offset); +@@ -1058,14 +1086,14 @@ static inline void uart_unlock_and_check_sysrq(struct uart_port *port) + u8 sysrq_ch; + + if (!port->has_sysrq) { +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + return; + } + + sysrq_ch = port->sysrq_ch; + port->sysrq_ch = 0; + +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + + if (sysrq_ch) + handle_sysrq(sysrq_ch); +@@ -1077,14 +1105,14 @@ static inline void uart_unlock_and_check_sysrq_irqrestore(struct uart_port *port + u8 sysrq_ch; + + if (!port->has_sysrq) { +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + return; + } + + sysrq_ch = port->sysrq_ch; + port->sysrq_ch = 0; + +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + + if (sysrq_ch) + handle_sysrq(sysrq_ch); +@@ -1100,12 +1128,12 @@ static inline int uart_prepare_sysrq_char(struct uart_port *port, u8 ch) + } + static inline void uart_unlock_and_check_sysrq(struct uart_port *port) + { +- spin_unlock(&port->lock); ++ uart_port_unlock(port); + } + static inline void uart_unlock_and_check_sysrq_irqrestore(struct uart_port *port, + unsigned long flags) + { +- spin_unlock_irqrestore(&port->lock, flags); ++ uart_port_unlock_irqrestore(port, flags); + } + #endif /* CONFIG_MAGIC_SYSRQ_SERIAL */ + +diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h +index 74d9fe360..0be63993d 100644 +--- a/include/linux/thread_info.h ++++ b/include/linux/thread_info.h +@@ -39,6 +39,16 @@ enum syscall_work_bit { + + #include + ++#ifdef CONFIG_PREEMPT_BUILD_AUTO ++# define TIF_NEED_RESCHED_LAZY TIF_ARCH_RESCHED_LAZY ++# define _TIF_NEED_RESCHED_LAZY _TIF_ARCH_RESCHED_LAZY ++# define TIF_NEED_RESCHED_LAZY_OFFSET (TIF_NEED_RESCHED_LAZY - TIF_NEED_RESCHED) ++#else ++# define TIF_NEED_RESCHED_LAZY TIF_NEED_RESCHED ++# define _TIF_NEED_RESCHED_LAZY _TIF_NEED_RESCHED ++# define TIF_NEED_RESCHED_LAZY_OFFSET 0 ++#endif ++ + #ifdef __KERNEL__ + + #ifndef arch_set_restart_data +@@ -114,6 +124,13 @@ static __always_inline bool tif_need_resched(void) + (unsigned long *)(¤t_thread_info()->flags)); + } + ++static __always_inline bool tif_need_resched_lazy(void) ++{ ++ return IS_ENABLED(CONFIG_PREEMPT_BUILD_AUTO) && ++ arch_test_bit(TIF_NEED_RESCHED_LAZY, ++ (unsigned long *)(¤t_thread_info()->flags)); ++} ++ + #else + + static __always_inline bool tif_need_resched(void) +@@ -122,6 +139,13 @@ static __always_inline bool tif_need_resched(void) + (unsigned long *)(¤t_thread_info()->flags)); + } + ++static __always_inline bool tif_need_resched_lazy(void) ++{ ++ return IS_ENABLED(CONFIG_PREEMPT_BUILD_AUTO) && ++ test_bit(TIF_NEED_RESCHED_LAZY, ++ (unsigned long *)(¤t_thread_info()->flags)); ++} ++ + #endif /* _ASM_GENERIC_BITOPS_INSTRUMENTED_NON_ATOMIC_H */ + + #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES +diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h +index ee9217fa4..1e594ace7 100644 +--- a/include/linux/trace_events.h ++++ b/include/linux/trace_events.h +@@ -179,8 +179,8 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status); + + enum trace_flag_type { + TRACE_FLAG_IRQS_OFF = 0x01, +- TRACE_FLAG_IRQS_NOSUPPORT = 0x02, +- TRACE_FLAG_NEED_RESCHED = 0x04, ++ TRACE_FLAG_NEED_RESCHED = 0x02, ++ TRACE_FLAG_NEED_RESCHED_LAZY = 0x04, + TRACE_FLAG_HARDIRQ = 0x08, + TRACE_FLAG_SOFTIRQ = 0x10, + TRACE_FLAG_PREEMPT_RESCHED = 0x20, +@@ -206,11 +206,11 @@ static inline unsigned int tracing_gen_ctx(void) + + static inline unsigned int tracing_gen_ctx_flags(unsigned long irqflags) + { +- return tracing_gen_ctx_irq_test(TRACE_FLAG_IRQS_NOSUPPORT); ++ return tracing_gen_ctx_irq_test(0); + } + static inline unsigned int tracing_gen_ctx(void) + { +- return tracing_gen_ctx_irq_test(TRACE_FLAG_IRQS_NOSUPPORT); ++ return tracing_gen_ctx_irq_test(0); + } + #endif + +diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt +index dc2a630f2..f6a3e3b53 100644 +--- a/kernel/Kconfig.preempt ++++ b/kernel/Kconfig.preempt +@@ -11,6 +11,13 @@ config PREEMPT_BUILD + select PREEMPTION + select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK + ++config PREEMPT_BUILD_AUTO ++ bool ++ select PREEMPT_BUILD ++ ++config HAVE_PREEMPT_AUTO ++ bool ++ + choice + prompt "Preemption Model" + default PREEMPT_NONE +@@ -67,9 +74,17 @@ config PREEMPT + embedded system with latency requirements in the milliseconds + range. + ++config PREEMPT_AUTO ++ bool "Automagic preemption mode with runtime tweaking support" ++ depends on HAVE_PREEMPT_AUTO ++ select PREEMPT_BUILD_AUTO ++ help ++ Add some sensible blurb here ++ + config PREEMPT_RT + bool "Fully Preemptible Kernel (Real-Time)" + depends on EXPERT && ARCH_SUPPORTS_RT ++ select PREEMPT_BUILD_AUTO if HAVE_PREEMPT_AUTO + select PREEMPTION + help + This option turns the kernel into a real-time kernel by replacing +@@ -95,7 +110,7 @@ config PREEMPTION + + config PREEMPT_DYNAMIC + bool "Preemption behaviour defined on boot" +- depends on HAVE_PREEMPT_DYNAMIC && !PREEMPT_RT ++ depends on HAVE_PREEMPT_DYNAMIC && !PREEMPT_RT && !PREEMPT_AUTO + select JUMP_LABEL if HAVE_PREEMPT_DYNAMIC_KEY + select PREEMPT_BUILD + default y if HAVE_PREEMPT_DYNAMIC_CALL +diff --git a/kernel/entry/common.c b/kernel/entry/common.c +index 5ff4f1cd3..fd42f0b17 100644 +--- a/kernel/entry/common.c ++++ b/kernel/entry/common.c +@@ -161,7 +161,7 @@ static unsigned long exit_to_user_mode_loop(struct pt_regs *regs, + + local_irq_enable_exit_to_user(ti_work); + +- if (ti_work & _TIF_NEED_RESCHED) ++ if (ti_work & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)) + schedule(); + + if (ti_work & _TIF_UPROBE) +@@ -391,7 +391,7 @@ void raw_irqentry_exit_cond_resched(void) + rcu_irq_exit_check_preempt(); + if (IS_ENABLED(CONFIG_DEBUG_ENTRY)) + WARN_ON_ONCE(!on_thread_stack()); +- if (need_resched()) ++ if (test_tsk_need_resched(current)) + preempt_schedule_irq(); + } + } +diff --git a/kernel/entry/kvm.c b/kernel/entry/kvm.c +index 2e0f75bcb..d952fa5ee 100644 +--- a/kernel/entry/kvm.c ++++ b/kernel/entry/kvm.c +@@ -13,7 +13,7 @@ static int xfer_to_guest_mode_work(struct kvm_vcpu *vcpu, unsigned long ti_work) + return -EINTR; + } + +- if (ti_work & _TIF_NEED_RESCHED) ++ if (ti_work & (_TIF_NEED_RESCHED | TIF_NEED_RESCHED_LAZY)) + schedule(); + + if (ti_work & _TIF_NOTIFY_RESUME) +diff --git a/kernel/futex/pi.c b/kernel/futex/pi.c +index ce2889f12..d636a1bbd 100644 +--- a/kernel/futex/pi.c ++++ b/kernel/futex/pi.c +@@ -1,6 +1,7 @@ + // SPDX-License-Identifier: GPL-2.0-or-later + + #include ++#include + #include + + #include "futex.h" +@@ -610,29 +611,16 @@ int futex_lock_pi_atomic(u32 __user *uaddr, struct futex_hash_bucket *hb, + /* + * Caller must hold a reference on @pi_state. + */ +-static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_pi_state *pi_state) ++static int wake_futex_pi(u32 __user *uaddr, u32 uval, ++ struct futex_pi_state *pi_state, ++ struct rt_mutex_waiter *top_waiter) + { +- struct rt_mutex_waiter *top_waiter; + struct task_struct *new_owner; + bool postunlock = false; + DEFINE_RT_WAKE_Q(wqh); + u32 curval, newval; + int ret = 0; + +- top_waiter = rt_mutex_top_waiter(&pi_state->pi_mutex); +- if (WARN_ON_ONCE(!top_waiter)) { +- /* +- * As per the comment in futex_unlock_pi() this should not happen. +- * +- * When this happens, give up our locks and try again, giving +- * the futex_lock_pi() instance time to complete, either by +- * waiting on the rtmutex or removing itself from the futex +- * queue. +- */ +- ret = -EAGAIN; +- goto out_unlock; +- } +- + new_owner = top_waiter->task; + + /* +@@ -1002,6 +990,12 @@ int futex_lock_pi(u32 __user *uaddr, unsigned int flags, ktime_t *time, int tryl + goto no_block; + } + ++ /* ++ * Must be done before we enqueue the waiter, here is unfortunately ++ * under the hb lock, but that *should* work because it does nothing. ++ */ ++ rt_mutex_pre_schedule(); ++ + rt_mutex_init_waiter(&rt_waiter); + + /* +@@ -1039,19 +1033,37 @@ int futex_lock_pi(u32 __user *uaddr, unsigned int flags, ktime_t *time, int tryl + ret = rt_mutex_wait_proxy_lock(&q.pi_state->pi_mutex, to, &rt_waiter); + + cleanup: +- spin_lock(q.lock_ptr); + /* + * If we failed to acquire the lock (deadlock/signal/timeout), we must +- * first acquire the hb->lock before removing the lock from the +- * rt_mutex waitqueue, such that we can keep the hb and rt_mutex wait +- * lists consistent. ++ * must unwind the above, however we canont lock hb->lock because ++ * rt_mutex already has a waiter enqueued and hb->lock can itself try ++ * and enqueue an rt_waiter through rtlock. ++ * ++ * Doing the cleanup without holding hb->lock can cause inconsistent ++ * state between hb and pi_state, but only in the direction of not ++ * seeing a waiter that is leaving. ++ * ++ * See futex_unlock_pi(), it deals with this inconsistency. ++ * ++ * There be dragons here, since we must deal with the inconsistency on ++ * the way out (here), it is impossible to detect/warn about the race ++ * the other way around (missing an incoming waiter). + * +- * In particular; it is important that futex_unlock_pi() can not +- * observe this inconsistency. ++ * What could possibly go wrong... + */ + if (ret && !rt_mutex_cleanup_proxy_lock(&q.pi_state->pi_mutex, &rt_waiter)) + ret = 0; + ++ /* ++ * Now that the rt_waiter has been dequeued, it is safe to use ++ * spinlock/rtlock (which might enqueue its own rt_waiter) and fix up ++ * the ++ */ ++ spin_lock(q.lock_ptr); ++ /* ++ * Waiter is unqueued. ++ */ ++ rt_mutex_post_schedule(); + no_block: + /* + * Fixup the pi_state owner and possibly acquire the lock if we +@@ -1132,6 +1144,7 @@ int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + top_waiter = futex_top_waiter(hb, &key); + if (top_waiter) { + struct futex_pi_state *pi_state = top_waiter->pi_state; ++ struct rt_mutex_waiter *rt_waiter; + + ret = -EINVAL; + if (!pi_state) +@@ -1144,22 +1157,39 @@ int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + if (pi_state->owner != current) + goto out_unlock; + +- get_pi_state(pi_state); + /* + * By taking wait_lock while still holding hb->lock, we ensure +- * there is no point where we hold neither; and therefore +- * wake_futex_p() must observe a state consistent with what we +- * observed. ++ * there is no point where we hold neither; and thereby ++ * wake_futex_pi() must observe any new waiters. ++ * ++ * Since the cleanup: case in futex_lock_pi() removes the ++ * rt_waiter without holding hb->lock, it is possible for ++ * wake_futex_pi() to not find a waiter while the above does, ++ * in this case the waiter is on the way out and it can be ++ * ignored. + * + * In particular; this forces __rt_mutex_start_proxy() to + * complete such that we're guaranteed to observe the +- * rt_waiter. Also see the WARN in wake_futex_pi(). ++ * rt_waiter. + */ + raw_spin_lock_irq(&pi_state->pi_mutex.wait_lock); ++ ++ /* ++ * Futex vs rt_mutex waiter state -- if there are no rt_mutex ++ * waiters even though futex thinks there are, then the waiter ++ * is leaving and the uncontended path is safe to take. ++ */ ++ rt_waiter = rt_mutex_top_waiter(&pi_state->pi_mutex); ++ if (!rt_waiter) { ++ raw_spin_unlock_irq(&pi_state->pi_mutex.wait_lock); ++ goto do_uncontended; ++ } ++ ++ get_pi_state(pi_state); + spin_unlock(&hb->lock); + + /* drops pi_state->pi_mutex.wait_lock */ +- ret = wake_futex_pi(uaddr, uval, pi_state); ++ ret = wake_futex_pi(uaddr, uval, pi_state, rt_waiter); + + put_pi_state(pi_state); + +@@ -1187,6 +1217,7 @@ int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) + return ret; + } + ++do_uncontended: + /* + * We have no kernel internal state, i.e. no waiters in the + * kernel. Waiters which are about to queue themselves are stuck +diff --git a/kernel/futex/requeue.c b/kernel/futex/requeue.c +index cba8b1a6a..4c73e0b81 100644 +--- a/kernel/futex/requeue.c ++++ b/kernel/futex/requeue.c +@@ -850,11 +850,13 @@ int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, + pi_mutex = &q.pi_state->pi_mutex; + ret = rt_mutex_wait_proxy_lock(pi_mutex, to, &rt_waiter); + +- /* Current is not longer pi_blocked_on */ +- spin_lock(q.lock_ptr); ++ /* ++ * See futex_unlock_pi()'s cleanup: comment. ++ */ + if (ret && !rt_mutex_cleanup_proxy_lock(pi_mutex, &rt_waiter)) + ret = 0; + ++ spin_lock(q.lock_ptr); + debug_rt_mutex_free_waiter(&rt_waiter); + /* + * Fixup the pi_state owner and possibly acquire the lock if we +diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c +index 1d4bc493b..486c68c11 100644 +--- a/kernel/ksysfs.c ++++ b/kernel/ksysfs.c +@@ -179,6 +179,15 @@ KERNEL_ATTR_RO(crash_elfcorehdr_size); + + #endif /* CONFIG_CRASH_CORE */ + ++#if defined(CONFIG_PREEMPT_RT) ++static ssize_t realtime_show(struct kobject *kobj, ++ struct kobj_attribute *attr, char *buf) ++{ ++ return sprintf(buf, "%d\n", 1); ++} ++KERNEL_ATTR_RO(realtime); ++#endif ++ + /* whether file capabilities are enabled */ + static ssize_t fscaps_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +@@ -274,6 +283,9 @@ static struct attribute * kernel_attrs[] = { + #ifndef CONFIG_TINY_RCU + &rcu_expedited_attr.attr, + &rcu_normal_attr.attr, ++#endif ++#ifdef CONFIG_PREEMPT_RT ++ &realtime_attr.attr, + #endif + NULL + }; +diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c +index 151bd3de5..5c21ba41e 100644 +--- a/kernel/locking/lockdep.c ++++ b/kernel/locking/lockdep.c +@@ -56,6 +56,7 @@ + #include + #include + #include ++#include + + #include + +@@ -3971,6 +3972,8 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this, + if (!debug_locks_off() || debug_locks_silent) + return; + ++ nbcon_cpu_emergency_enter(); ++ + pr_warn("\n"); + pr_warn("================================\n"); + pr_warn("WARNING: inconsistent lock state\n"); +@@ -3999,6 +4002,8 @@ print_usage_bug(struct task_struct *curr, struct held_lock *this, + + pr_warn("\nstack backtrace:\n"); + dump_stack(); ++ ++ nbcon_cpu_emergency_exit(); + } + + /* +diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c +index 21db0df0e..4a10e8c16 100644 +--- a/kernel/locking/rtmutex.c ++++ b/kernel/locking/rtmutex.c +@@ -218,6 +218,11 @@ static __always_inline bool rt_mutex_cmpxchg_acquire(struct rt_mutex_base *lock, + return try_cmpxchg_acquire(&lock->owner, &old, new); + } + ++static __always_inline bool rt_mutex_try_acquire(struct rt_mutex_base *lock) ++{ ++ return rt_mutex_cmpxchg_acquire(lock, NULL, current); ++} ++ + static __always_inline bool rt_mutex_cmpxchg_release(struct rt_mutex_base *lock, + struct task_struct *old, + struct task_struct *new) +@@ -297,6 +302,20 @@ static __always_inline bool rt_mutex_cmpxchg_acquire(struct rt_mutex_base *lock, + + } + ++static int __sched rt_mutex_slowtrylock(struct rt_mutex_base *lock); ++ ++static __always_inline bool rt_mutex_try_acquire(struct rt_mutex_base *lock) ++{ ++ /* ++ * With debug enabled rt_mutex_cmpxchg trylock() will always fail. ++ * ++ * Avoid unconditionally taking the slow path by using ++ * rt_mutex_slow_trylock() which is covered by the debug code and can ++ * acquire a non-contended rtmutex. ++ */ ++ return rt_mutex_slowtrylock(lock); ++} ++ + static __always_inline bool rt_mutex_cmpxchg_release(struct rt_mutex_base *lock, + struct task_struct *old, + struct task_struct *new) +@@ -1613,7 +1632,7 @@ static int __sched rt_mutex_slowlock_block(struct rt_mutex_base *lock, + raw_spin_unlock_irq(&lock->wait_lock); + + if (!owner || !rtmutex_spin_on_owner(lock, waiter, owner)) +- schedule(); ++ rt_mutex_schedule(); + + raw_spin_lock_irq(&lock->wait_lock); + set_current_state(state); +@@ -1642,7 +1661,7 @@ static void __sched rt_mutex_handle_deadlock(int res, int detect_deadlock, + WARN(1, "rtmutex deadlock detected\n"); + while (1) { + set_current_state(TASK_INTERRUPTIBLE); +- schedule(); ++ rt_mutex_schedule(); + } + } + +@@ -1737,6 +1756,15 @@ static int __sched rt_mutex_slowlock(struct rt_mutex_base *lock, + unsigned long flags; + int ret; + ++ /* ++ * Do all pre-schedule work here, before we queue a waiter and invoke ++ * PI -- any such work that trips on rtlock (PREEMPT_RT spinlock) would ++ * otherwise recurse back into task_blocks_on_rt_mutex() through ++ * rtlock_slowlock() and will then enqueue a second waiter for this ++ * same task and things get really confusing real fast. ++ */ ++ rt_mutex_pre_schedule(); ++ + /* + * Technically we could use raw_spin_[un]lock_irq() here, but this can + * be called in early boot if the cmpxchg() fast path is disabled +@@ -1748,6 +1776,7 @@ static int __sched rt_mutex_slowlock(struct rt_mutex_base *lock, + raw_spin_lock_irqsave(&lock->wait_lock, flags); + ret = __rt_mutex_slowlock_locked(lock, ww_ctx, state); + raw_spin_unlock_irqrestore(&lock->wait_lock, flags); ++ rt_mutex_post_schedule(); + + return ret; + } +@@ -1755,7 +1784,9 @@ static int __sched rt_mutex_slowlock(struct rt_mutex_base *lock, + static __always_inline int __rt_mutex_lock(struct rt_mutex_base *lock, + unsigned int state) + { +- if (likely(rt_mutex_cmpxchg_acquire(lock, NULL, current))) ++ lockdep_assert(!current->pi_blocked_on); ++ ++ if (likely(rt_mutex_try_acquire(lock))) + return 0; + + return rt_mutex_slowlock(lock, NULL, state); +diff --git a/kernel/locking/rwbase_rt.c b/kernel/locking/rwbase_rt.c +index 25ec02394..34a59569d 100644 +--- a/kernel/locking/rwbase_rt.c ++++ b/kernel/locking/rwbase_rt.c +@@ -71,6 +71,7 @@ static int __sched __rwbase_read_lock(struct rwbase_rt *rwb, + struct rt_mutex_base *rtm = &rwb->rtmutex; + int ret; + ++ rwbase_pre_schedule(); + raw_spin_lock_irq(&rtm->wait_lock); + + /* +@@ -125,12 +126,15 @@ static int __sched __rwbase_read_lock(struct rwbase_rt *rwb, + rwbase_rtmutex_unlock(rtm); + + trace_contention_end(rwb, ret); ++ rwbase_post_schedule(); + return ret; + } + + static __always_inline int rwbase_read_lock(struct rwbase_rt *rwb, + unsigned int state) + { ++ lockdep_assert(!current->pi_blocked_on); ++ + if (rwbase_read_trylock(rwb)) + return 0; + +@@ -237,6 +241,8 @@ static int __sched rwbase_write_lock(struct rwbase_rt *rwb, + /* Force readers into slow path */ + atomic_sub(READER_BIAS, &rwb->readers); + ++ rwbase_pre_schedule(); ++ + raw_spin_lock_irqsave(&rtm->wait_lock, flags); + if (__rwbase_write_trylock(rwb)) + goto out_unlock; +@@ -248,6 +254,7 @@ static int __sched rwbase_write_lock(struct rwbase_rt *rwb, + if (rwbase_signal_pending_state(state, current)) { + rwbase_restore_current_state(); + __rwbase_write_unlock(rwb, 0, flags); ++ rwbase_post_schedule(); + trace_contention_end(rwb, -EINTR); + return -EINTR; + } +@@ -266,6 +273,7 @@ static int __sched rwbase_write_lock(struct rwbase_rt *rwb, + + out_unlock: + raw_spin_unlock_irqrestore(&rtm->wait_lock, flags); ++ rwbase_post_schedule(); + return 0; + } + +diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c +index 9eabd585c..2340b6d90 100644 +--- a/kernel/locking/rwsem.c ++++ b/kernel/locking/rwsem.c +@@ -1427,8 +1427,14 @@ static inline void __downgrade_write(struct rw_semaphore *sem) + #define rwbase_signal_pending_state(state, current) \ + signal_pending_state(state, current) + ++#define rwbase_pre_schedule() \ ++ rt_mutex_pre_schedule() ++ + #define rwbase_schedule() \ +- schedule() ++ rt_mutex_schedule() ++ ++#define rwbase_post_schedule() \ ++ rt_mutex_post_schedule() + + #include "rwbase_rt.c" + +diff --git a/kernel/locking/spinlock_rt.c b/kernel/locking/spinlock_rt.c +index 48a19ed84..38e292454 100644 +--- a/kernel/locking/spinlock_rt.c ++++ b/kernel/locking/spinlock_rt.c +@@ -37,6 +37,8 @@ + + static __always_inline void rtlock_lock(struct rt_mutex_base *rtm) + { ++ lockdep_assert(!current->pi_blocked_on); ++ + if (unlikely(!rt_mutex_cmpxchg_acquire(rtm, NULL, current))) + rtlock_slowlock(rtm); + } +@@ -184,9 +186,13 @@ static __always_inline int rwbase_rtmutex_trylock(struct rt_mutex_base *rtm) + + #define rwbase_signal_pending_state(state, current) (0) + ++#define rwbase_pre_schedule() ++ + #define rwbase_schedule() \ + schedule_rtlock() + ++#define rwbase_post_schedule() ++ + #include "rwbase_rt.c" + /* + * The common functions which get wrapped into the rwlock API. +diff --git a/kernel/locking/ww_rt_mutex.c b/kernel/locking/ww_rt_mutex.c +index d1473c624..c7196de83 100644 +--- a/kernel/locking/ww_rt_mutex.c ++++ b/kernel/locking/ww_rt_mutex.c +@@ -62,7 +62,7 @@ __ww_rt_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ww_ctx, + } + mutex_acquire_nest(&rtm->dep_map, 0, 0, nest_lock, ip); + +- if (likely(rt_mutex_cmpxchg_acquire(&rtm->rtmutex, NULL, current))) { ++ if (likely(rt_mutex_try_acquire(&rtm->rtmutex))) { + if (ww_ctx) + ww_mutex_set_context_fastpath(lock, ww_ctx); + return 0; +diff --git a/kernel/panic.c b/kernel/panic.c +index ef9f9a4e9..76d452dc7 100644 +--- a/kernel/panic.c ++++ b/kernel/panic.c +@@ -366,6 +366,8 @@ void panic(const char *fmt, ...) + */ + atomic_notifier_call_chain(&panic_notifier_list, 0, buf); + ++ printk_legacy_allow_panic_sync(); ++ + panic_print_sys_info(false); + + kmsg_dump(KMSG_DUMP_PANIC); +@@ -449,6 +451,7 @@ void panic(const char *fmt, ...) + * Explicitly flush the kernel log buffer one last time. + */ + console_flush_on_panic(CONSOLE_FLUSH_PENDING); ++ nbcon_atomic_flush_unsafe(); + + local_irq_enable(); + for (i = 0; ; i += PANIC_TIMER_STEP) { +@@ -627,6 +630,7 @@ bool oops_may_print(void) + */ + void oops_enter(void) + { ++ nbcon_cpu_emergency_enter(); + tracing_off(); + /* can't trust the integrity of the kernel anymore: */ + debug_locks_off(); +@@ -649,6 +653,7 @@ void oops_exit(void) + { + do_oops_enter_exit(); + print_oops_end_marker(); ++ nbcon_cpu_emergency_exit(); + kmsg_dump(KMSG_DUMP_OOPS); + } + +@@ -660,6 +665,8 @@ struct warn_args { + void __warn(const char *file, int line, void *caller, unsigned taint, + struct pt_regs *regs, struct warn_args *args) + { ++ nbcon_cpu_emergency_enter(); ++ + disable_trace_on_warning(); + + if (file) +@@ -690,6 +697,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint, + + /* Just a warning, don't kill lockdep. */ + add_taint(taint, LOCKDEP_STILL_OK); ++ ++ nbcon_cpu_emergency_exit(); + } + + #ifdef CONFIG_BUG +diff --git a/kernel/printk/Makefile b/kernel/printk/Makefile +index f5b388e81..39a2b61c7 100644 +--- a/kernel/printk/Makefile ++++ b/kernel/printk/Makefile +@@ -1,6 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0-only + obj-y = printk.o +-obj-$(CONFIG_PRINTK) += printk_safe.o ++obj-$(CONFIG_PRINTK) += printk_safe.o nbcon.o + obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille.o + obj-$(CONFIG_PRINTK_INDEX) += index.o + +diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h +index 7d4979d5c..7db6992c5 100644 +--- a/kernel/printk/internal.h ++++ b/kernel/printk/internal.h +@@ -3,6 +3,8 @@ + * internal.h - printk internal definitions + */ + #include ++#include ++#include "printk_ringbuffer.h" + + #if defined(CONFIG_PRINTK) && defined(CONFIG_SYSCTL) + void __init printk_sysctl_init(void); +@@ -12,6 +14,12 @@ int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, + #define printk_sysctl_init() do { } while (0) + #endif + ++#define con_printk(lvl, con, fmt, ...) \ ++ printk(lvl pr_fmt("%s%sconsole [%s%d] " fmt), \ ++ (con->flags & CON_NBCON) ? "" : "legacy ", \ ++ (con->flags & CON_BOOT) ? "boot" : "", \ ++ con->name, con->index, ##__VA_ARGS__) ++ + #ifdef CONFIG_PRINTK + + #ifdef CONFIG_PRINTK_CALLER +@@ -35,6 +43,19 @@ enum printk_info_flags { + LOG_CONT = 8, /* text is a fragment of a continuation line */ + }; + ++extern struct printk_ringbuffer *prb; ++extern bool printk_threads_enabled; ++extern bool have_legacy_console; ++extern bool have_boot_console; ++ ++/* ++ * Specifies if the console lock/unlock dance is needed for console ++ * printing. If @have_boot_console is true, the nbcon consoles will ++ * be printed serially along with the legacy consoles because nbcon ++ * consoles cannot print simultaneously with boot consoles. ++ */ ++#define printing_via_unlock (have_legacy_console || have_boot_console) ++ + __printf(4, 0) + int vprintk_store(int facility, int level, + const struct dev_printk_info *dev_info, +@@ -61,12 +82,90 @@ void defer_console_output(void); + + u16 printk_parse_prefix(const char *text, int *level, + enum printk_info_flags *flags); ++void console_lock_spinning_enable(void); ++int console_lock_spinning_disable_and_check(int cookie); ++ ++u64 nbcon_seq_read(struct console *con); ++void nbcon_seq_force(struct console *con, u64 seq); ++bool nbcon_alloc(struct console *con); ++void nbcon_init(struct console *con); ++void nbcon_free(struct console *con); ++enum nbcon_prio nbcon_get_default_prio(void); ++void nbcon_atomic_flush_all(void); ++bool nbcon_atomic_emit_next_record(struct console *con, bool *handover, int cookie); ++void nbcon_kthread_create(struct console *con); ++void nbcon_wake_threads(void); ++void nbcon_legacy_kthread_create(void); ++ ++/* ++ * Check if the given console is currently capable and allowed to print ++ * records. Note that this function does not consider the current context, ++ * which can also play a role in deciding if @con can be used to print ++ * records. ++ */ ++static inline bool console_is_usable(struct console *con, short flags, bool use_atomic) ++{ ++ if (!(flags & CON_ENABLED)) ++ return false; ++ ++ if ((flags & CON_SUSPENDED)) ++ return false; ++ ++ if (flags & CON_NBCON) { ++ if (use_atomic) { ++ if (!con->write_atomic) ++ return false; ++ } else { ++ if (!con->write_thread || !con->kthread) ++ return false; ++ } ++ } else { ++ if (!con->write) ++ return false; ++ } ++ ++ /* ++ * Console drivers may assume that per-cpu resources have been ++ * allocated. So unless they're explicitly marked as being able to ++ * cope (CON_ANYTIME) don't call them until this CPU is officially up. ++ */ ++ if (!cpu_online(raw_smp_processor_id()) && !(flags & CON_ANYTIME)) ++ return false; ++ ++ return true; ++} ++ ++/** ++ * nbcon_kthread_wake - Wake up a printk thread ++ * @con: Console to operate on ++ */ ++static inline void nbcon_kthread_wake(struct console *con) ++{ ++ /* ++ * Guarantee any new records can be seen by tasks preparing to wait ++ * before this context checks if the rcuwait is empty. ++ * ++ * The full memory barrier in rcuwait_wake_up() pairs with the full ++ * memory barrier within set_current_state() of ++ * ___rcuwait_wait_event(), which is called after prepare_to_rcuwait() ++ * adds the waiter but before it has checked the wait condition. ++ * ++ * This pairs with nbcon_kthread_func:A. ++ */ ++ rcuwait_wake_up(&con->rcuwait); /* LMM(nbcon_kthread_wake:A) */ ++} ++ + #else + + #define PRINTK_PREFIX_MAX 0 + #define PRINTK_MESSAGE_MAX 0 + #define PRINTKRB_RECORD_MAX 0 + ++static inline void nbcon_kthread_wake(struct console *con) { } ++static inline void nbcon_kthread_create(struct console *con) { } ++#define printk_threads_enabled (false) ++#define printing_via_unlock (false) ++ + /* + * In !PRINTK builds we still export console_sem + * semaphore and some of console functions (console_unlock()/etc.), so +@@ -76,8 +175,23 @@ u16 printk_parse_prefix(const char *text, int *level, + #define printk_safe_exit_irqrestore(flags) local_irq_restore(flags) + + static inline bool printk_percpu_data_ready(void) { return false; } ++static inline u64 nbcon_seq_read(struct console *con) { return 0; } ++static inline void nbcon_seq_force(struct console *con, u64 seq) { } ++static inline bool nbcon_alloc(struct console *con) { return false; } ++static inline void nbcon_init(struct console *con) { } ++static inline void nbcon_free(struct console *con) { } ++static inline enum nbcon_prio nbcon_get_default_prio(void) { return NBCON_PRIO_NONE; } ++static inline void nbcon_atomic_flush_all(void) { } ++static inline bool nbcon_atomic_emit_next_record(struct console *con, bool *handover, ++ int cookie) { return false; } ++ ++static inline bool console_is_usable(struct console *con, short flags, ++ bool use_atomic) { return false; } ++ + #endif /* CONFIG_PRINTK */ + ++extern struct printk_buffers printk_shared_pbufs; ++ + /** + * struct printk_buffers - Buffers to read/format/output printk messages. + * @outbuf: After formatting, contains text to output. +@@ -105,3 +219,10 @@ struct printk_message { + }; + + bool other_cpu_in_panic(void); ++bool this_cpu_in_panic(void); ++bool printk_get_next_message(struct printk_message *pmsg, u64 seq, ++ bool is_extended, bool may_supress); ++ ++#ifdef CONFIG_PRINTK ++void console_prepend_dropped(struct printk_message *pmsg, unsigned long dropped); ++#endif +diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c +new file mode 100644 +index 000000000..1b1b585b1 +--- /dev/null ++++ b/kernel/printk/nbcon.c +@@ -0,0 +1,1664 @@ ++// SPDX-License-Identifier: GPL-2.0-only ++// Copyright (C) 2022 Linutronix GmbH, John Ogness ++// Copyright (C) 2022 Intel, Thomas Gleixner ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "printk_ringbuffer.h" ++#include "internal.h" ++/* ++ * Printk console printing implementation for consoles which does not depend ++ * on the legacy style console_lock mechanism. ++ * ++ * The state of the console is maintained in the "nbcon_state" atomic ++ * variable. ++ * ++ * The console is locked when: ++ * ++ * - The 'prio' field contains the priority of the context that owns the ++ * console. Only higher priority contexts are allowed to take over the ++ * lock. A value of 0 (NBCON_PRIO_NONE) means the console is not locked. ++ * ++ * - The 'cpu' field denotes on which CPU the console is locked. It is used ++ * to prevent busy waiting on the same CPU. Also it informs the lock owner ++ * that it has lost the lock in a more complex scenario when the lock was ++ * taken over by a higher priority context, released, and taken on another ++ * CPU with the same priority as the interrupted owner. ++ * ++ * The acquire mechanism uses a few more fields: ++ * ++ * - The 'req_prio' field is used by the handover approach to make the ++ * current owner aware that there is a context with a higher priority ++ * waiting for the friendly handover. ++ * ++ * - The 'unsafe' field allows to take over the console in a safe way in the ++ * middle of emitting a message. The field is set only when accessing some ++ * shared resources or when the console device is manipulated. It can be ++ * cleared, for example, after emitting one character when the console ++ * device is in a consistent state. ++ * ++ * - The 'unsafe_takeover' field is set when a hostile takeover took the ++ * console in an unsafe state. The console will stay in the unsafe state ++ * until re-initialized. ++ * ++ * The acquire mechanism uses three approaches: ++ * ++ * 1) Direct acquire when the console is not owned or is owned by a lower ++ * priority context and is in a safe state. ++ * ++ * 2) Friendly handover mechanism uses a request/grant handshake. It is used ++ * when the current owner has lower priority and the console is in an ++ * unsafe state. ++ * ++ * The requesting context: ++ * ++ * a) Sets its priority into the 'req_prio' field. ++ * ++ * b) Waits (with a timeout) for the owning context to unlock the ++ * console. ++ * ++ * c) Takes the lock and clears the 'req_prio' field. ++ * ++ * The owning context: ++ * ++ * a) Observes the 'req_prio' field set on exit from the unsafe ++ * console state. ++ * ++ * b) Gives up console ownership by clearing the 'prio' field. ++ * ++ * 3) Unsafe hostile takeover allows to take over the lock even when the ++ * console is an unsafe state. It is used only in panic() by the final ++ * attempt to flush consoles in a try and hope mode. ++ * ++ * Note that separate record buffers are used in panic(). As a result, ++ * the messages can be read and formatted without any risk even after ++ * using the hostile takeover in unsafe state. ++ * ++ * The release function simply clears the 'prio' field. ++ * ++ * All operations on @console::nbcon_state are atomic cmpxchg based to ++ * handle concurrency. ++ * ++ * The acquire/release functions implement only minimal policies: ++ * ++ * - Preference for higher priority contexts. ++ * - Protection of the panic CPU. ++ * ++ * All other policy decisions must be made at the call sites: ++ * ++ * - What is marked as an unsafe section. ++ * - Whether to spin-wait if there is already an owner and the console is ++ * in an unsafe state. ++ * - Whether to attempt an unsafe hostile takeover. ++ * ++ * The design allows to implement the well known: ++ * ++ * acquire() ++ * output_one_printk_record() ++ * release() ++ * ++ * The output of one printk record might be interrupted with a higher priority ++ * context. The new owner is supposed to reprint the entire interrupted record ++ * from scratch. ++ */ ++ ++/** ++ * nbcon_state_set - Helper function to set the console state ++ * @con: Console to update ++ * @new: The new state to write ++ * ++ * Only to be used when the console is not yet or no longer visible in the ++ * system. Otherwise use nbcon_state_try_cmpxchg(). ++ */ ++static inline void nbcon_state_set(struct console *con, struct nbcon_state *new) ++{ ++ atomic_set(&ACCESS_PRIVATE(con, nbcon_state), new->atom); ++} ++ ++/** ++ * nbcon_state_read - Helper function to read the console state ++ * @con: Console to read ++ * @state: The state to store the result ++ */ ++static inline void nbcon_state_read(struct console *con, struct nbcon_state *state) ++{ ++ state->atom = atomic_read(&ACCESS_PRIVATE(con, nbcon_state)); ++} ++ ++/** ++ * nbcon_state_try_cmpxchg() - Helper function for atomic_try_cmpxchg() on console state ++ * @con: Console to update ++ * @cur: Old/expected state ++ * @new: New state ++ * ++ * Return: True on success. False on fail and @cur is updated. ++ */ ++static inline bool nbcon_state_try_cmpxchg(struct console *con, struct nbcon_state *cur, ++ struct nbcon_state *new) ++{ ++ return atomic_try_cmpxchg(&ACCESS_PRIVATE(con, nbcon_state), &cur->atom, new->atom); ++} ++ ++/** ++ * nbcon_seq_read - Read the current console sequence ++ * @con: Console to read the sequence of ++ * ++ * Return: Sequence number of the next record to print on @con. ++ */ ++u64 nbcon_seq_read(struct console *con) ++{ ++ unsigned long nbcon_seq = atomic_long_read(&ACCESS_PRIVATE(con, nbcon_seq)); ++ ++ return __ulseq_to_u64seq(prb, nbcon_seq); ++} ++ ++/** ++ * nbcon_seq_force - Force console sequence to a specific value ++ * @con: Console to work on ++ * @seq: Sequence number value to set ++ * ++ * Only to be used during init (before registration) or in extreme situations ++ * (such as panic with CONSOLE_REPLAY_ALL). ++ */ ++void nbcon_seq_force(struct console *con, u64 seq) ++{ ++ /* ++ * If the specified record no longer exists, the oldest available record ++ * is chosen. This is especially important on 32bit systems because only ++ * the lower 32 bits of the sequence number are stored. The upper 32 bits ++ * are derived from the sequence numbers available in the ringbuffer. ++ */ ++ u64 valid_seq = max_t(u64, seq, prb_first_valid_seq(prb)); ++ ++ atomic_long_set(&ACCESS_PRIVATE(con, nbcon_seq), __u64seq_to_ulseq(valid_seq)); ++ ++ /* Clear con->seq since nbcon consoles use con->nbcon_seq instead. */ ++ con->seq = 0; ++} ++ ++/** ++ * nbcon_seq_try_update - Try to update the console sequence number ++ * @ctxt: Pointer to an acquire context that contains ++ * all information about the acquire mode ++ * @new_seq: The new sequence number to set ++ * ++ * @ctxt->seq is updated to the new value of @con::nbcon_seq (expanded to ++ * the 64bit value). This could be a different value than @new_seq if ++ * nbcon_seq_force() was used or the current context no longer owns the ++ * console. In the later case, it will stop printing anyway. ++ */ ++static void nbcon_seq_try_update(struct nbcon_context *ctxt, u64 new_seq) ++{ ++ unsigned long nbcon_seq = __u64seq_to_ulseq(ctxt->seq); ++ struct console *con = ctxt->console; ++ ++ if (atomic_long_try_cmpxchg(&ACCESS_PRIVATE(con, nbcon_seq), &nbcon_seq, ++ __u64seq_to_ulseq(new_seq))) { ++ ctxt->seq = new_seq; ++ } else { ++ ctxt->seq = nbcon_seq_read(con); ++ } ++} ++ ++bool printk_threads_enabled __ro_after_init; ++ ++/** ++ * nbcon_context_try_acquire_direct - Try to acquire directly ++ * @ctxt: The context of the caller ++ * @cur: The current console state ++ * ++ * Acquire the console when it is released. Also acquire the console when ++ * the current owner has a lower priority and the console is in a safe state. ++ * ++ * Return: 0 on success. Otherwise, an error code on failure. Also @cur ++ * is updated to the latest state when failed to modify it. ++ * ++ * Errors: ++ * ++ * -EPERM: A panic is in progress and this is not the panic CPU. ++ * Or the current owner or waiter has the same or higher ++ * priority. No acquire method can be successful in ++ * this case. ++ * ++ * -EBUSY: The current owner has a lower priority but the console ++ * in an unsafe state. The caller should try using ++ * the handover acquire method. ++ */ ++static int nbcon_context_try_acquire_direct(struct nbcon_context *ctxt, ++ struct nbcon_state *cur) ++{ ++ unsigned int cpu = smp_processor_id(); ++ struct console *con = ctxt->console; ++ struct nbcon_state new; ++ ++ do { ++ if (other_cpu_in_panic()) ++ return -EPERM; ++ ++ if (ctxt->prio <= cur->prio || ctxt->prio <= cur->req_prio) ++ return -EPERM; ++ ++ if (cur->unsafe) ++ return -EBUSY; ++ ++ /* ++ * The console should never be safe for a direct acquire ++ * if an unsafe hostile takeover has ever happened. ++ */ ++ WARN_ON_ONCE(cur->unsafe_takeover); ++ ++ new.atom = cur->atom; ++ new.prio = ctxt->prio; ++ new.req_prio = NBCON_PRIO_NONE; ++ new.unsafe = cur->unsafe_takeover; ++ new.cpu = cpu; ++ ++ } while (!nbcon_state_try_cmpxchg(con, cur, &new)); ++ ++ return 0; ++} ++ ++static bool nbcon_waiter_matches(struct nbcon_state *cur, int expected_prio) ++{ ++ /* ++ * The request context is well defined by the @req_prio because: ++ * ++ * - Only a context with a higher priority can take over the request. ++ * - There are only three priorities. ++ * - Only one CPU is allowed to request PANIC priority. ++ * - Lower priorities are ignored during panic() until reboot. ++ * ++ * As a result, the following scenario is *not* possible: ++ * ++ * 1. Another context with a higher priority directly takes ownership. ++ * 2. The higher priority context releases the ownership. ++ * 3. A lower priority context takes the ownership. ++ * 4. Another context with the same priority as this context ++ * creates a request and starts waiting. ++ */ ++ ++ return (cur->req_prio == expected_prio); ++} ++ ++/** ++ * nbcon_context_try_acquire_requested - Try to acquire after having ++ * requested a handover ++ * @ctxt: The context of the caller ++ * @cur: The current console state ++ * ++ * This is a helper function for nbcon_context_try_acquire_handover(). ++ * It is called when the console is in an unsafe state. The current ++ * owner will release the console on exit from the unsafe region. ++ * ++ * Return: 0 on success and @cur is updated to the new console state. ++ * Otherwise an error code on failure. ++ * ++ * Errors: ++ * ++ * -EPERM: A panic is in progress and this is not the panic CPU ++ * or this context is no longer the waiter. ++ * ++ * -EBUSY: The console is still locked. The caller should ++ * continue waiting. ++ * ++ * Note: The caller must still remove the request when an error has occurred ++ * except when this context is no longer the waiter. ++ */ ++static int nbcon_context_try_acquire_requested(struct nbcon_context *ctxt, ++ struct nbcon_state *cur) ++{ ++ unsigned int cpu = smp_processor_id(); ++ struct console *con = ctxt->console; ++ struct nbcon_state new; ++ ++ /* Note that the caller must still remove the request! */ ++ if (other_cpu_in_panic()) ++ return -EPERM; ++ ++ /* ++ * Note that the waiter will also change if there was an unsafe ++ * hostile takeover. ++ */ ++ if (!nbcon_waiter_matches(cur, ctxt->prio)) ++ return -EPERM; ++ ++ /* If still locked, caller should continue waiting. */ ++ if (cur->prio != NBCON_PRIO_NONE) ++ return -EBUSY; ++ ++ /* ++ * The previous owner should have never released ownership ++ * in an unsafe region. ++ */ ++ WARN_ON_ONCE(cur->unsafe); ++ ++ new.atom = cur->atom; ++ new.prio = ctxt->prio; ++ new.req_prio = NBCON_PRIO_NONE; ++ new.unsafe = cur->unsafe_takeover; ++ new.cpu = cpu; ++ ++ if (!nbcon_state_try_cmpxchg(con, cur, &new)) { ++ /* ++ * The acquire could fail only when it has been taken ++ * over by a higher priority context. ++ */ ++ WARN_ON_ONCE(nbcon_waiter_matches(cur, ctxt->prio)); ++ return -EPERM; ++ } ++ ++ /* Handover success. This context now owns the console. */ ++ return 0; ++} ++ ++/** ++ * nbcon_context_try_acquire_handover - Try to acquire via handover ++ * @ctxt: The context of the caller ++ * @cur: The current console state ++ * ++ * The function must be called only when the context has higher priority ++ * than the current owner and the console is in an unsafe state. ++ * It is the case when nbcon_context_try_acquire_direct() returns -EBUSY. ++ * ++ * The function sets "req_prio" field to make the current owner aware of ++ * the request. Then it waits until the current owner releases the console, ++ * or an even higher context takes over the request, or timeout expires. ++ * ++ * The current owner checks the "req_prio" field on exit from the unsafe ++ * region and releases the console. It does not touch the "req_prio" field ++ * so that the console stays reserved for the waiter. ++ * ++ * Return: 0 on success. Otherwise, an error code on failure. Also @cur ++ * is updated to the latest state when failed to modify it. ++ * ++ * Errors: ++ * ++ * -EPERM: A panic is in progress and this is not the panic CPU. ++ * Or a higher priority context has taken over the ++ * console or the handover request. ++ * ++ * -EBUSY: The current owner is on the same CPU so that the hand ++ * shake could not work. Or the current owner is not ++ * willing to wait (zero timeout). Or the console does ++ * not enter the safe state before timeout passed. The ++ * caller might still use the unsafe hostile takeover ++ * when allowed. ++ * ++ * -EAGAIN: @cur has changed when creating the handover request. ++ * The caller should retry with direct acquire. ++ */ ++static int nbcon_context_try_acquire_handover(struct nbcon_context *ctxt, ++ struct nbcon_state *cur) ++{ ++ unsigned int cpu = smp_processor_id(); ++ struct console *con = ctxt->console; ++ struct nbcon_state new; ++ int timeout; ++ int request_err = -EBUSY; ++ ++ /* ++ * Check that the handover is called when the direct acquire failed ++ * with -EBUSY. ++ */ ++ WARN_ON_ONCE(ctxt->prio <= cur->prio || ctxt->prio <= cur->req_prio); ++ WARN_ON_ONCE(!cur->unsafe); ++ ++ /* Handover is not possible on the same CPU. */ ++ if (cur->cpu == cpu) ++ return -EBUSY; ++ ++ /* ++ * Console stays unsafe after an unsafe takeover until re-initialized. ++ * Waiting is not going to help in this case. ++ */ ++ if (cur->unsafe_takeover) ++ return -EBUSY; ++ ++ /* Is the caller willing to wait? */ ++ if (ctxt->spinwait_max_us == 0) ++ return -EBUSY; ++ ++ /* ++ * Setup a request for the handover. The caller should try to acquire ++ * the console directly when the current state has been modified. ++ */ ++ new.atom = cur->atom; ++ new.req_prio = ctxt->prio; ++ if (!nbcon_state_try_cmpxchg(con, cur, &new)) ++ return -EAGAIN; ++ ++ cur->atom = new.atom; ++ ++ /* Wait until there is no owner and then acquire the console. */ ++ for (timeout = ctxt->spinwait_max_us; timeout >= 0; timeout--) { ++ /* On successful acquire, this request is cleared. */ ++ request_err = nbcon_context_try_acquire_requested(ctxt, cur); ++ if (!request_err) ++ return 0; ++ ++ /* ++ * If the acquire should be aborted, it must be ensured ++ * that the request is removed before returning to caller. ++ */ ++ if (request_err == -EPERM) ++ break; ++ ++ udelay(1); ++ ++ /* Re-read the state because some time has passed. */ ++ nbcon_state_read(con, cur); ++ } ++ ++ /* Timed out or aborted. Carefully remove handover request. */ ++ do { ++ /* ++ * No need to remove request if there is a new waiter. This ++ * can only happen if a higher priority context has taken over ++ * the console or the handover request. ++ */ ++ if (!nbcon_waiter_matches(cur, ctxt->prio)) ++ return -EPERM; ++ ++ /* Unset request for handover. */ ++ new.atom = cur->atom; ++ new.req_prio = NBCON_PRIO_NONE; ++ if (nbcon_state_try_cmpxchg(con, cur, &new)) { ++ /* ++ * Request successfully unset. Report failure of ++ * acquiring via handover. ++ */ ++ cur->atom = new.atom; ++ return request_err; ++ } ++ ++ /* ++ * Unable to remove request. Try to acquire in case ++ * the owner has released the lock. ++ */ ++ } while (nbcon_context_try_acquire_requested(ctxt, cur)); ++ ++ /* Lucky timing. The acquire succeeded while removing the request. */ ++ return 0; ++} ++ ++/** ++ * nbcon_context_try_acquire_hostile - Acquire via unsafe hostile takeover ++ * @ctxt: The context of the caller ++ * @cur: The current console state ++ * ++ * Acquire the console even in the unsafe state. ++ * ++ * It can be permitted by setting the 'allow_unsafe_takeover' field only ++ * by the final attempt to flush messages in panic(). ++ * ++ * Return: 0 on success. -EPERM when not allowed by the context. ++ */ ++static int nbcon_context_try_acquire_hostile(struct nbcon_context *ctxt, ++ struct nbcon_state *cur) ++{ ++ unsigned int cpu = smp_processor_id(); ++ struct console *con = ctxt->console; ++ struct nbcon_state new; ++ ++ if (!ctxt->allow_unsafe_takeover) ++ return -EPERM; ++ ++ /* Ensure caller is allowed to perform unsafe hostile takeovers. */ ++ if (WARN_ON_ONCE(ctxt->prio != NBCON_PRIO_PANIC)) ++ return -EPERM; ++ ++ /* ++ * Check that try_acquire_direct() and try_acquire_handover() returned ++ * -EBUSY in the right situation. ++ */ ++ WARN_ON_ONCE(ctxt->prio <= cur->prio || ctxt->prio <= cur->req_prio); ++ WARN_ON_ONCE(cur->unsafe != true); ++ ++ do { ++ new.atom = cur->atom; ++ new.cpu = cpu; ++ new.prio = ctxt->prio; ++ new.unsafe |= cur->unsafe_takeover; ++ new.unsafe_takeover |= cur->unsafe; ++ ++ } while (!nbcon_state_try_cmpxchg(con, cur, &new)); ++ ++ return 0; ++} ++ ++static struct printk_buffers panic_nbcon_pbufs; ++ ++/** ++ * nbcon_context_try_acquire - Try to acquire nbcon console ++ * @ctxt: The context of the caller ++ * ++ * Context: Any context which could not be migrated to another CPU. ++ * Return: True if the console was acquired. False otherwise. ++ * ++ * If the caller allowed an unsafe hostile takeover, on success the ++ * caller should check the current console state to see if it is ++ * in an unsafe state. Otherwise, on success the caller may assume ++ * the console is not in an unsafe state. ++ */ ++static bool nbcon_context_try_acquire(struct nbcon_context *ctxt) ++{ ++ unsigned int cpu = smp_processor_id(); ++ struct console *con = ctxt->console; ++ struct nbcon_state cur; ++ int err; ++ ++ nbcon_state_read(con, &cur); ++try_again: ++ err = nbcon_context_try_acquire_direct(ctxt, &cur); ++ if (err != -EBUSY) ++ goto out; ++ ++ err = nbcon_context_try_acquire_handover(ctxt, &cur); ++ if (err == -EAGAIN) ++ goto try_again; ++ if (err != -EBUSY) ++ goto out; ++ ++ err = nbcon_context_try_acquire_hostile(ctxt, &cur); ++out: ++ if (err) ++ return false; ++ ++ /* Acquire succeeded. */ ++ ++ /* Assign the appropriate buffer for this context. */ ++ if (atomic_read(&panic_cpu) == cpu) ++ ctxt->pbufs = &panic_nbcon_pbufs; ++ else ++ ctxt->pbufs = con->pbufs; ++ ++ /* Set the record sequence for this context to print. */ ++ ctxt->seq = nbcon_seq_read(ctxt->console); ++ ++ return true; ++} ++ ++static bool nbcon_owner_matches(struct nbcon_state *cur, int expected_cpu, ++ int expected_prio) ++{ ++ /* ++ * Since consoles can only be acquired by higher priorities, ++ * owning contexts are uniquely identified by @prio. However, ++ * since contexts can unexpectedly lose ownership, it is ++ * possible that later another owner appears with the same ++ * priority. For this reason @cpu is also needed. ++ */ ++ ++ if (cur->prio != expected_prio) ++ return false; ++ ++ if (cur->cpu != expected_cpu) ++ return false; ++ ++ return true; ++} ++ ++/** ++ * nbcon_context_release - Release the console ++ * @ctxt: The nbcon context from nbcon_context_try_acquire() ++ */ ++static void nbcon_context_release(struct nbcon_context *ctxt) ++{ ++ unsigned int cpu = smp_processor_id(); ++ struct console *con = ctxt->console; ++ struct nbcon_state cur; ++ struct nbcon_state new; ++ ++ nbcon_state_read(con, &cur); ++ ++ do { ++ if (!nbcon_owner_matches(&cur, cpu, ctxt->prio)) ++ break; ++ ++ new.atom = cur.atom; ++ new.prio = NBCON_PRIO_NONE; ++ ++ /* ++ * If @unsafe_takeover is set, it is kept set so that ++ * the state remains permanently unsafe. ++ */ ++ new.unsafe |= cur.unsafe_takeover; ++ ++ } while (!nbcon_state_try_cmpxchg(con, &cur, &new)); ++ ++ ctxt->pbufs = NULL; ++} ++ ++/** ++ * nbcon_context_can_proceed - Check whether ownership can proceed ++ * @ctxt: The nbcon context from nbcon_context_try_acquire() ++ * @cur: The current console state ++ * ++ * Return: True if this context still owns the console. False if ++ * ownership was handed over or taken. ++ * ++ * Must be invoked when entering the unsafe state to make sure that it still ++ * owns the lock. Also must be invoked when exiting the unsafe context ++ * to eventually free the lock for a higher priority context which asked ++ * for the friendly handover. ++ * ++ * It can be called inside an unsafe section when the console is just ++ * temporary in safe state instead of exiting and entering the unsafe ++ * state. ++ * ++ * Also it can be called in the safe context before doing an expensive ++ * safe operation. It does not make sense to do the operation when ++ * a higher priority context took the lock. ++ * ++ * When this function returns false then the calling context no longer owns ++ * the console and is no longer allowed to go forward. In this case it must ++ * back out immediately and carefully. The buffer content is also no longer ++ * trusted since it no longer belongs to the calling context. ++ */ ++static bool nbcon_context_can_proceed(struct nbcon_context *ctxt, struct nbcon_state *cur) ++{ ++ unsigned int cpu = smp_processor_id(); ++ ++ /* Make sure this context still owns the console. */ ++ if (!nbcon_owner_matches(cur, cpu, ctxt->prio)) ++ return false; ++ ++ /* The console owner can proceed if there is no waiter. */ ++ if (cur->req_prio == NBCON_PRIO_NONE) ++ return true; ++ ++ /* ++ * A console owner within an unsafe region is always allowed to ++ * proceed, even if there are waiters. It can perform a handover ++ * when exiting the unsafe region. Otherwise the waiter will ++ * need to perform an unsafe hostile takeover. ++ */ ++ if (cur->unsafe) ++ return true; ++ ++ /* Waiters always have higher priorities than owners. */ ++ WARN_ON_ONCE(cur->req_prio <= cur->prio); ++ ++ /* ++ * Having a safe point for take over and eventually a few ++ * duplicated characters or a full line is way better than a ++ * hostile takeover. Post processing can take care of the garbage. ++ * Release and hand over. ++ */ ++ nbcon_context_release(ctxt); ++ ++ /* ++ * It is not clear whether the waiter really took over ownership. The ++ * outermost callsite must make the final decision whether console ++ * ownership is needed for it to proceed. If yes, it must reacquire ++ * ownership (possibly hostile) before carefully proceeding. ++ * ++ * The calling context no longer owns the console so go back all the ++ * way instead of trying to implement reacquire heuristics in tons of ++ * places. ++ */ ++ return false; ++} ++ ++/** ++ * nbcon_can_proceed - Check whether ownership can proceed ++ * @wctxt: The write context that was handed to the write function ++ * ++ * Return: True if this context still owns the console. False if ++ * ownership was handed over or taken. ++ * ++ * It is used in nbcon_enter_unsafe() to make sure that it still owns the ++ * lock. Also it is used in nbcon_exit_unsafe() to eventually free the lock ++ * for a higher priority context which asked for the friendly handover. ++ * ++ * It can be called inside an unsafe section when the console is just ++ * temporary in safe state instead of exiting and entering the unsafe state. ++ * ++ * Also it can be called in the safe context before doing an expensive safe ++ * operation. It does not make sense to do the operation when a higher ++ * priority context took the lock. ++ * ++ * When this function returns false then the calling context no longer owns ++ * the console and is no longer allowed to go forward. In this case it must ++ * back out immediately and carefully. The buffer content is also no longer ++ * trusted since it no longer belongs to the calling context. ++ */ ++bool nbcon_can_proceed(struct nbcon_write_context *wctxt) ++{ ++ struct nbcon_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ struct console *con = ctxt->console; ++ struct nbcon_state cur; ++ ++ nbcon_state_read(con, &cur); ++ ++ return nbcon_context_can_proceed(ctxt, &cur); ++} ++EXPORT_SYMBOL_GPL(nbcon_can_proceed); ++ ++#define nbcon_context_enter_unsafe(c) __nbcon_context_update_unsafe(c, true) ++#define nbcon_context_exit_unsafe(c) __nbcon_context_update_unsafe(c, false) ++ ++/** ++ * __nbcon_context_update_unsafe - Update the unsafe bit in @con->nbcon_state ++ * @ctxt: The nbcon context from nbcon_context_try_acquire() ++ * @unsafe: The new value for the unsafe bit ++ * ++ * Return: True if the unsafe state was updated and this context still ++ * owns the console. Otherwise false if ownership was handed ++ * over or taken. ++ * ++ * This function allows console owners to modify the unsafe status of the ++ * console. ++ * ++ * When this function returns false then the calling context no longer owns ++ * the console and is no longer allowed to go forward. In this case it must ++ * back out immediately and carefully. The buffer content is also no longer ++ * trusted since it no longer belongs to the calling context. ++ * ++ * Internal helper to avoid duplicated code. ++ */ ++static bool __nbcon_context_update_unsafe(struct nbcon_context *ctxt, bool unsafe) ++{ ++ struct console *con = ctxt->console; ++ struct nbcon_state cur; ++ struct nbcon_state new; ++ ++ nbcon_state_read(con, &cur); ++ ++ do { ++ /* ++ * The unsafe bit must not be cleared if an ++ * unsafe hostile takeover has occurred. ++ */ ++ if (!unsafe && cur.unsafe_takeover) ++ goto out; ++ ++ if (!nbcon_context_can_proceed(ctxt, &cur)) ++ return false; ++ ++ new.atom = cur.atom; ++ new.unsafe = unsafe; ++ } while (!nbcon_state_try_cmpxchg(con, &cur, &new)); ++ ++ cur.atom = new.atom; ++out: ++ return nbcon_context_can_proceed(ctxt, &cur); ++} ++ ++/** ++ * nbcon_enter_unsafe - Enter an unsafe region in the driver ++ * @wctxt: The write context that was handed to the write function ++ * ++ * Return: True if this context still owns the console. False if ++ * ownership was handed over or taken. ++ * ++ * When this function returns false then the calling context no longer owns ++ * the console and is no longer allowed to go forward. In this case it must ++ * back out immediately and carefully. The buffer content is also no longer ++ * trusted since it no longer belongs to the calling context. ++ */ ++bool nbcon_enter_unsafe(struct nbcon_write_context *wctxt) ++{ ++ struct nbcon_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ ++ return nbcon_context_enter_unsafe(ctxt); ++} ++EXPORT_SYMBOL_GPL(nbcon_enter_unsafe); ++ ++/** ++ * nbcon_exit_unsafe - Exit an unsafe region in the driver ++ * @wctxt: The write context that was handed to the write function ++ * ++ * Return: True if this context still owns the console. False if ++ * ownership was handed over or taken. ++ * ++ * When this function returns false then the calling context no longer owns ++ * the console and is no longer allowed to go forward. In this case it must ++ * back out immediately and carefully. The buffer content is also no longer ++ * trusted since it no longer belongs to the calling context. ++ */ ++bool nbcon_exit_unsafe(struct nbcon_write_context *wctxt) ++{ ++ struct nbcon_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ ++ return nbcon_context_exit_unsafe(ctxt); ++} ++EXPORT_SYMBOL_GPL(nbcon_exit_unsafe); ++ ++/** ++ * nbcon_reacquire - Reacquire a console after losing ownership ++ * @wctxt: The write context that was handed to the write function ++ * ++ * Since ownership can be lost at any time due to handover or takeover, a ++ * printing context _should_ be prepared to back out immediately and ++ * carefully. However, there are many scenarios where the context _must_ ++ * reacquire ownership in order to finalize or revert hardware changes. ++ * ++ * This function allows a context to reacquire ownership using the same ++ * priority as its previous ownership. ++ * ++ * Note that for printing contexts, after a successful reacquire the ++ * context will have no output buffer because that has been lost. This ++ * function cannot be used to resume printing. ++ */ ++void nbcon_reacquire(struct nbcon_write_context *wctxt) ++{ ++ struct nbcon_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ struct console *con = ctxt->console; ++ struct nbcon_state cur; ++ ++ while (!nbcon_context_try_acquire(ctxt)) ++ cpu_relax(); ++ ++ wctxt->outbuf = NULL; ++ wctxt->len = 0; ++ nbcon_state_read(con, &cur); ++ wctxt->unsafe_takeover = cur.unsafe_takeover; ++} ++EXPORT_SYMBOL_GPL(nbcon_reacquire); ++ ++/** ++ * nbcon_emit_next_record - Emit a record in the acquired context ++ * @wctxt: The write context that will be handed to the write function ++ * @use_atomic: True if the write_atomic callback is to be used ++ * ++ * Return: True if this context still owns the console. False if ++ * ownership was handed over or taken. ++ * ++ * When this function returns false then the calling context no longer owns ++ * the console and is no longer allowed to go forward. In this case it must ++ * back out immediately and carefully. The buffer content is also no longer ++ * trusted since it no longer belongs to the calling context. If the caller ++ * wants to do more it must reacquire the console first. ++ * ++ * When true is returned, @wctxt->ctxt.backlog indicates whether there are ++ * still records pending in the ringbuffer, ++ */ ++static bool nbcon_emit_next_record(struct nbcon_write_context *wctxt, bool use_atomic) ++{ ++ struct nbcon_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ struct console *con = ctxt->console; ++ bool is_extended = console_srcu_read_flags(con) & CON_EXTENDED; ++ struct printk_message pmsg = { ++ .pbufs = ctxt->pbufs, ++ }; ++ unsigned long con_dropped; ++ struct nbcon_state cur; ++ unsigned long dropped; ++ bool done = false; ++ ++ /* ++ * The printk buffers are filled within an unsafe section. This ++ * prevents NBCON_PRIO_NORMAL and NBCON_PRIO_EMERGENCY from ++ * clobbering each other. ++ */ ++ ++ if (!nbcon_context_enter_unsafe(ctxt)) ++ return false; ++ ++ ctxt->backlog = printk_get_next_message(&pmsg, ctxt->seq, is_extended, true); ++ if (!ctxt->backlog) ++ return nbcon_context_exit_unsafe(ctxt); ++ ++ /* ++ * @con->dropped is not protected in case of an unsafe hostile ++ * takeover. In that situation the update can be racy so ++ * annotate it accordingly. ++ */ ++ con_dropped = data_race(READ_ONCE(con->dropped)); ++ ++ dropped = con_dropped + pmsg.dropped; ++ if (dropped && !is_extended) ++ console_prepend_dropped(&pmsg, dropped); ++ ++ if (!nbcon_context_exit_unsafe(ctxt)) ++ return false; ++ ++ /* For skipped records just update seq/dropped in @con. */ ++ if (pmsg.outbuf_len == 0) ++ goto update_con; ++ ++ /* Initialize the write context for driver callbacks. */ ++ wctxt->outbuf = &pmsg.pbufs->outbuf[0]; ++ wctxt->len = pmsg.outbuf_len; ++ nbcon_state_read(con, &cur); ++ wctxt->unsafe_takeover = cur.unsafe_takeover; ++ ++ if (use_atomic && ++ con->write_atomic) { ++ done = con->write_atomic(con, wctxt); ++ ++ } else if (!use_atomic && ++ con->write_thread && ++ con->kthread) { ++ WARN_ON_ONCE(con->kthread != current); ++ done = con->write_thread(con, wctxt); ++ } ++ ++ if (!done) { ++ /* ++ * The emit was aborted, probably due to a loss of ownership. ++ * Ensure ownership was lost or released before reporting the ++ * loss. ++ */ ++ nbcon_context_release(ctxt); ++ return false; ++ } ++ ++ /* ++ * Since any dropped message was successfully output, reset the ++ * dropped count for the console. ++ */ ++ dropped = 0; ++update_con: ++ /* ++ * The dropped count and the sequence number are updated within an ++ * unsafe section. This limits update races to the panic context and ++ * allows the panic context to win. ++ */ ++ ++ if (!nbcon_context_enter_unsafe(ctxt)) ++ return false; ++ ++ if (dropped != con_dropped) { ++ /* Counterpart to the READ_ONCE() above. */ ++ WRITE_ONCE(con->dropped, dropped); ++ } ++ ++ nbcon_seq_try_update(ctxt, pmsg.seq + 1); ++ ++ return nbcon_context_exit_unsafe(ctxt); ++} ++ ++/** ++ * nbcon_kthread_should_wakeup - Check whether a printer thread should wakeup ++ * @con: Console to operate on ++ * @ctxt: The acquire context that contains the state ++ * at console_acquire() ++ * ++ * Return: True if the thread should shutdown or if the console is ++ * allowed to print and a record is available. False otherwise. ++ * ++ * After the thread wakes up, it must first check if it should shutdown before ++ * attempting any printing. ++ */ ++static bool nbcon_kthread_should_wakeup(struct console *con, struct nbcon_context *ctxt) ++{ ++ bool is_usable; ++ short flags; ++ int cookie; ++ ++ if (kthread_should_stop()) ++ return true; ++ ++ cookie = console_srcu_read_lock(); ++ flags = console_srcu_read_flags(con); ++ is_usable = console_is_usable(con, flags, false); ++ console_srcu_read_unlock(cookie); ++ ++ if (!is_usable) ++ return false; ++ ++ /* Bring the sequence in @ctxt up to date */ ++ ctxt->seq = nbcon_seq_read(con); ++ ++ return prb_read_valid(prb, ctxt->seq, NULL); ++} ++ ++/** ++ * nbcon_kthread_func - The printer thread function ++ * @__console: Console to operate on ++ */ ++static int nbcon_kthread_func(void *__console) ++{ ++ struct console *con = __console; ++ struct nbcon_write_context wctxt = { ++ .ctxt.console = con, ++ .ctxt.prio = NBCON_PRIO_NORMAL, ++ }; ++ struct nbcon_context *ctxt = &ACCESS_PRIVATE(&wctxt, ctxt); ++ unsigned long flags; ++ short con_flags; ++ bool backlog; ++ int cookie; ++ int ret; ++ ++wait_for_event: ++ /* ++ * Guarantee this task is visible on the rcuwait before ++ * checking the wake condition. ++ * ++ * The full memory barrier within set_current_state() of ++ * ___rcuwait_wait_event() pairs with the full memory ++ * barrier within rcuwait_has_sleeper(). ++ * ++ * This pairs with rcuwait_has_sleeper:A and nbcon_kthread_wake:A. ++ */ ++ ret = rcuwait_wait_event(&con->rcuwait, ++ nbcon_kthread_should_wakeup(con, ctxt), ++ TASK_INTERRUPTIBLE); /* LMM(nbcon_kthread_func:A) */ ++ ++ if (kthread_should_stop()) ++ return 0; ++ ++ /* Wait was interrupted by a spurious signal, go back to sleep. */ ++ if (ret) ++ goto wait_for_event; ++ ++ do { ++ backlog = false; ++ ++ cookie = console_srcu_read_lock(); ++ ++ con_flags = console_srcu_read_flags(con); ++ ++ if (console_is_usable(con, con_flags, false)) { ++ con->driver_enter(con, &flags); ++ ++ /* ++ * Ensure this stays on the CPU to make handover and ++ * takeover possible. ++ */ ++ cant_migrate(); ++ ++ if (nbcon_context_try_acquire(ctxt)) { ++ /* ++ * If the emit fails, this context is no ++ * longer the owner. ++ */ ++ if (nbcon_emit_next_record(&wctxt, false)) { ++ nbcon_context_release(ctxt); ++ backlog = ctxt->backlog; ++ } ++ } ++ ++ con->driver_exit(con, flags); ++ } ++ ++ console_srcu_read_unlock(cookie); ++ ++ } while (backlog); ++ ++ goto wait_for_event; ++} ++ ++/** ++ * nbcon_irq_work - irq work to wake printk thread ++ * @irq_work: The irq work to operate on ++ */ ++static void nbcon_irq_work(struct irq_work *irq_work) ++{ ++ struct console *con = container_of(irq_work, struct console, irq_work); ++ ++ nbcon_kthread_wake(con); ++} ++ ++static inline bool rcuwait_has_sleeper(struct rcuwait *w) ++{ ++ bool has_sleeper; ++ ++ rcu_read_lock(); ++ /* ++ * Guarantee any new records can be seen by tasks preparing to wait ++ * before this context checks if the rcuwait is empty. ++ * ++ * This full memory barrier pairs with the full memory barrier within ++ * set_current_state() of ___rcuwait_wait_event(), which is called ++ * after prepare_to_rcuwait() adds the waiter but before it has ++ * checked the wait condition. ++ * ++ * This pairs with nbcon_kthread_func:A. ++ */ ++ smp_mb(); /* LMM(rcuwait_has_sleeper:A) */ ++ has_sleeper = !!rcu_dereference(w->task); ++ rcu_read_unlock(); ++ ++ return has_sleeper; ++} ++ ++/** ++ * nbcon_wake_threads - Wake up printing threads using irq_work ++ */ ++void nbcon_wake_threads(void) ++{ ++ struct console *con; ++ int cookie; ++ ++ cookie = console_srcu_read_lock(); ++ for_each_console_srcu(con) { ++ /* ++ * Only schedule irq_work if the printing thread is ++ * actively waiting. If not waiting, the thread will ++ * notice by itself that it has work to do. ++ */ ++ if (con->kthread && rcuwait_has_sleeper(&con->rcuwait)) ++ irq_work_queue(&con->irq_work); ++ } ++ console_srcu_read_unlock(cookie); ++} ++ ++/* Track the nbcon emergency nesting per CPU. */ ++static DEFINE_PER_CPU(unsigned int, nbcon_pcpu_emergency_nesting); ++static unsigned int early_nbcon_pcpu_emergency_nesting __initdata; ++ ++/** ++ * nbcon_get_cpu_emergency_nesting - Get the per CPU emergency nesting pointer ++ * ++ * Return: Either a pointer to the per CPU emergency nesting counter of ++ * the current CPU or to the init data during early boot. ++ */ ++static __ref unsigned int *nbcon_get_cpu_emergency_nesting(void) ++{ ++ /* ++ * The value of __printk_percpu_data_ready gets set in normal ++ * context and before SMP initialization. As a result it could ++ * never change while inside an nbcon emergency section. ++ */ ++ if (!printk_percpu_data_ready()) ++ return &early_nbcon_pcpu_emergency_nesting; ++ ++ return this_cpu_ptr(&nbcon_pcpu_emergency_nesting); ++} ++ ++/** ++ * nbcon_atomic_emit_one - Print one record for an nbcon console using the ++ * write_atomic() callback ++ * @wctxt: An initialized write context struct to use ++ * for this context ++ * ++ * Return: False if the given console could not print a record or there ++ * are no more records to print, otherwise true. ++ * ++ * This is an internal helper to handle the locking of the console before ++ * calling nbcon_emit_next_record(). ++ */ ++static bool nbcon_atomic_emit_one(struct nbcon_write_context *wctxt) ++{ ++ struct nbcon_context *ctxt = &ACCESS_PRIVATE(wctxt, ctxt); ++ ++ if (!nbcon_context_try_acquire(ctxt)) ++ return false; ++ ++ /* ++ * nbcon_emit_next_record() returns false when the console was ++ * handed over or taken over. In both cases the context is no ++ * longer valid. ++ */ ++ if (!nbcon_emit_next_record(wctxt, true)) ++ return false; ++ ++ nbcon_context_release(ctxt); ++ ++ return ctxt->backlog; ++} ++ ++/** ++ * nbcon_get_default_prio - The appropriate nbcon priority to use for nbcon ++ * printing on the current CPU ++ * ++ * Context: Any context which could not be migrated to another CPU. ++ * Return: The nbcon_prio to use for acquiring an nbcon console in this ++ * context for printing. ++ */ ++enum nbcon_prio nbcon_get_default_prio(void) ++{ ++ unsigned int *cpu_emergency_nesting; ++ ++ if (this_cpu_in_panic()) ++ return NBCON_PRIO_PANIC; ++ ++ cpu_emergency_nesting = nbcon_get_cpu_emergency_nesting(); ++ if (*cpu_emergency_nesting) ++ return NBCON_PRIO_EMERGENCY; ++ ++ return NBCON_PRIO_NORMAL; ++} ++ ++/** ++ * nbcon_atomic_emit_next_record - Print one record for an nbcon console ++ * using the write_atomic() callback ++ * @con: The console to print on ++ * @handover: Will be set to true if a printk waiter has taken over the ++ * console_lock, in which case the caller is no longer holding ++ * both the console_lock and the SRCU read lock. Otherwise it ++ * is set to false. ++ * @cookie: The cookie from the SRCU read lock. ++ * ++ * Context: Any context which could not be migrated to another CPU. ++ * Return: True if a record could be printed, otherwise false. ++ * ++ * This function is meant to be called by console_flush_all() to print records ++ * on nbcon consoles using the write_atomic() callback. Essentially it is the ++ * nbcon version of console_emit_next_record(). ++ */ ++bool nbcon_atomic_emit_next_record(struct console *con, bool *handover, int cookie) ++{ ++ struct nbcon_write_context wctxt = { }; ++ struct nbcon_context *ctxt = &ACCESS_PRIVATE(&wctxt, ctxt); ++ unsigned long driver_flags; ++ bool progress = false; ++ unsigned long flags; ++ ++ *handover = false; ++ ++ /* Use the same locking order as console_emit_next_record(). */ ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) { ++ printk_safe_enter_irqsave(flags); ++ console_lock_spinning_enable(); ++ stop_critical_timings(); ++ } ++ ++ con->driver_enter(con, &driver_flags); ++ cant_migrate(); ++ ++ ctxt->console = con; ++ ctxt->prio = nbcon_get_default_prio(); ++ ++ progress = nbcon_atomic_emit_one(&wctxt); ++ ++ con->driver_exit(con, driver_flags); ++ ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) { ++ start_critical_timings(); ++ *handover = console_lock_spinning_disable_and_check(cookie); ++ printk_safe_exit_irqrestore(flags); ++ } ++ ++ return progress; ++} ++ ++/** ++ * __nbcon_atomic_flush_all - Flush all nbcon consoles using their ++ * write_atomic() callback ++ * @stop_seq: Flush up until this record ++ * @allow_unsafe_takeover: True, to allow unsafe hostile takeovers ++ */ ++static void __nbcon_atomic_flush_all(u64 stop_seq, bool allow_unsafe_takeover) ++{ ++ struct nbcon_write_context wctxt = { }; ++ struct nbcon_context *ctxt = &ACCESS_PRIVATE(&wctxt, ctxt); ++ struct console *con; ++ bool any_progress; ++ int cookie; ++ ++ do { ++ any_progress = false; ++ ++ cookie = console_srcu_read_lock(); ++ for_each_console_srcu(con) { ++ short flags = console_srcu_read_flags(con); ++ unsigned long irq_flags; ++ ++ if (!(flags & CON_NBCON)) ++ continue; ++ ++ if (!console_is_usable(con, flags, true)) ++ continue; ++ ++ if (nbcon_seq_read(con) >= stop_seq) ++ continue; ++ ++ memset(ctxt, 0, sizeof(*ctxt)); ++ ctxt->console = con; ++ ctxt->spinwait_max_us = 2000; ++ ctxt->allow_unsafe_takeover = allow_unsafe_takeover; ++ ++ /* ++ * Atomic flushing does not use console driver ++ * synchronization (i.e. it does not hold the port ++ * lock for uart consoles). Therefore IRQs must be ++ * disabled to avoid being interrupted and then ++ * calling into a driver that will deadlock trying ++ * acquire console ownership. ++ * ++ * This also disables migration in order to get the ++ * current CPU priority. ++ */ ++ local_irq_save(irq_flags); ++ ++ ctxt->prio = nbcon_get_default_prio(); ++ ++ any_progress |= nbcon_atomic_emit_one(&wctxt); ++ ++ local_irq_restore(irq_flags); ++ } ++ console_srcu_read_unlock(cookie); ++ } while (any_progress); ++} ++ ++/** ++ * nbcon_atomic_flush_all - Flush all nbcon consoles using their ++ * write_atomic() callback ++ * ++ * Flush the backlog up through the currently newest record. Any new ++ * records added while flushing will not be flushed. This is to avoid ++ * one CPU printing unbounded because other CPUs continue to add records. ++ */ ++void nbcon_atomic_flush_all(void) ++{ ++ __nbcon_atomic_flush_all(prb_next_reserve_seq(prb), false); ++} ++ ++/** ++ * nbcon_atomic_flush_unsafe - Flush all nbcon consoles using their ++ * write_atomic() callback and allowing unsafe hostile takeovers ++ * ++ * Flush the backlog up through the currently newest record. Unsafe hostile ++ * takeovers will be performed, if necessary. ++ */ ++void nbcon_atomic_flush_unsafe(void) ++{ ++ __nbcon_atomic_flush_all(prb_next_reserve_seq(prb), true); ++} ++ ++/** ++ * nbcon_cpu_emergency_enter - Enter an emergency section where printk() ++ * messages for that CPU are only stored ++ * ++ * Upon exiting the emergency section, all stored messages are flushed. ++ * ++ * Context: Any context. Disables preemption. ++ * ++ * When within an emergency section, no printing occurs on that CPU. This ++ * is to allow all emergency messages to be dumped into the ringbuffer before ++ * flushing the ringbuffer. The actual printing occurs when exiting the ++ * outermost emergency section. ++ */ ++void nbcon_cpu_emergency_enter(void) ++{ ++ unsigned int *cpu_emergency_nesting; ++ ++ preempt_disable(); ++ ++ cpu_emergency_nesting = nbcon_get_cpu_emergency_nesting(); ++ (*cpu_emergency_nesting)++; ++} ++ ++/** ++ * nbcon_cpu_emergency_exit - Exit an emergency section and flush the ++ * stored messages ++ * ++ * Flushing only occurs when exiting all nesting for the CPU. ++ * ++ * Context: Any context. Enables preemption. ++ */ ++void nbcon_cpu_emergency_exit(void) ++{ ++ unsigned int *cpu_emergency_nesting; ++ bool do_trigger_flush = false; ++ ++ cpu_emergency_nesting = nbcon_get_cpu_emergency_nesting(); ++ ++ WARN_ON_ONCE(*cpu_emergency_nesting == 0); ++ ++ if (*cpu_emergency_nesting == 1) ++ do_trigger_flush = true; ++ ++ /* Undo the nesting count of nbcon_cpu_emergency_enter(). */ ++ (*cpu_emergency_nesting)--; ++ ++ preempt_enable(); ++ ++ if (do_trigger_flush) ++ printk_trigger_flush(); ++} ++ ++/** ++ * nbcon_kthread_stop - Stop a printer thread ++ * @con: Console to operate on ++ */ ++static void nbcon_kthread_stop(struct console *con) ++{ ++ lockdep_assert_console_list_lock_held(); ++ ++ if (!con->kthread) ++ return; ++ ++ kthread_stop(con->kthread); ++ con->kthread = NULL; ++} ++ ++/** ++ * nbcon_kthread_create - Create a printer thread ++ * @con: Console to operate on ++ * ++ * If it fails, let the console proceed. The atomic part might ++ * be usable and useful. ++ */ ++void nbcon_kthread_create(struct console *con) ++{ ++ struct task_struct *kt; ++ ++ lockdep_assert_console_list_lock_held(); ++ ++ if (!(con->flags & CON_NBCON) || !con->write_thread) ++ return; ++ ++ if (!printk_threads_enabled || con->kthread) ++ return; ++ ++ /* ++ * Printer threads cannot be started as long as any boot console is ++ * registered because there is no way to synchronize the hardware ++ * registers between boot console code and regular console code. ++ */ ++ if (have_boot_console) ++ return; ++ ++ kt = kthread_run(nbcon_kthread_func, con, "pr/%s%d", con->name, con->index); ++ if (IS_ERR(kt)) { ++ con_printk(KERN_ERR, con, "failed to start printing thread\n"); ++ return; ++ } ++ ++ con->kthread = kt; ++ ++ /* ++ * It is important that console printing threads are scheduled ++ * shortly after a printk call and with generous runtime budgets. ++ */ ++ sched_set_normal(con->kthread, -20); ++} ++ ++static int __init printk_setup_threads(void) ++{ ++ struct console *con; ++ ++ console_list_lock(); ++ printk_threads_enabled = true; ++ for_each_console(con) ++ nbcon_kthread_create(con); ++ if (IS_ENABLED(CONFIG_PREEMPT_RT) && printing_via_unlock) ++ nbcon_legacy_kthread_create(); ++ console_list_unlock(); ++ return 0; ++} ++early_initcall(printk_setup_threads); ++ ++/** ++ * nbcon_alloc - Allocate buffers needed by the nbcon console ++ * @con: Console to allocate buffers for ++ * ++ * Return: True on success. False otherwise and the console cannot ++ * be used. ++ * ++ * This is not part of nbcon_init() because buffer allocation must ++ * be performed earlier in the console registration process. ++ */ ++bool nbcon_alloc(struct console *con) ++{ ++ if (con->flags & CON_BOOT) { ++ /* ++ * Boot console printing is synchronized with legacy console ++ * printing, so boot consoles can share the same global printk ++ * buffers. ++ */ ++ con->pbufs = &printk_shared_pbufs; ++ } else { ++ con->pbufs = kmalloc(sizeof(*con->pbufs), GFP_KERNEL); ++ if (!con->pbufs) { ++ con_printk(KERN_ERR, con, "failed to allocate printing buffer\n"); ++ return false; ++ } ++ } ++ ++ return true; ++} ++ ++/** ++ * nbcon_init - Initialize the nbcon console specific data ++ * @con: Console to initialize ++ * ++ * nbcon_alloc() *must* be called and succeed before this function ++ * is called. ++ * ++ * This function expects that the legacy @con->seq has been set. ++ */ ++void nbcon_init(struct console *con) ++{ ++ struct nbcon_state state = { }; ++ ++ /* nbcon_alloc() must have been called and successful! */ ++ BUG_ON(!con->pbufs); ++ ++ rcuwait_init(&con->rcuwait); ++ init_irq_work(&con->irq_work, nbcon_irq_work); ++ nbcon_seq_force(con, con->seq); ++ nbcon_state_set(con, &state); ++ nbcon_kthread_create(con); ++} ++ ++/** ++ * nbcon_free - Free and cleanup the nbcon console specific data ++ * @con: Console to free/cleanup nbcon data ++ */ ++void nbcon_free(struct console *con) ++{ ++ struct nbcon_state state = { }; ++ ++ nbcon_kthread_stop(con); ++ nbcon_state_set(con, &state); ++ ++ /* Boot consoles share global printk buffers. */ ++ if (!(con->flags & CON_BOOT)) ++ kfree(con->pbufs); ++ ++ con->pbufs = NULL; ++} ++ ++static inline bool uart_is_nbcon(struct uart_port *up) ++{ ++ int cookie; ++ bool ret; ++ ++ if (!uart_console(up)) ++ return false; ++ ++ cookie = console_srcu_read_lock(); ++ ret = (console_srcu_read_flags(up->cons) & CON_NBCON); ++ console_srcu_read_unlock(cookie); ++ return ret; ++} ++ ++/** ++ * nbcon_acquire - The second half of the port locking wrapper ++ * @up: The uart port whose @lock was locked ++ * ++ * The uart_port_lock() wrappers will first lock the spin_lock @up->lock. ++ * Then this function is called to implement nbcon-specific processing. ++ * ++ * If @up is an nbcon console, this console will be acquired and marked as ++ * unsafe. Otherwise this function does nothing. ++ * ++ * nbcon consoles acquired via the port lock wrapper always use priority ++ * NBCON_PRIO_NORMAL. ++ */ ++void nbcon_acquire(struct uart_port *up) ++{ ++ struct console *con = up->cons; ++ struct nbcon_context ctxt; ++ ++ if (!uart_is_nbcon(up)) ++ return; ++ ++ WARN_ON_ONCE(con->locked_port); ++ ++ do { ++ do { ++ memset(&ctxt, 0, sizeof(ctxt)); ++ ctxt.console = con; ++ ctxt.prio = NBCON_PRIO_NORMAL; ++ } while (!nbcon_context_try_acquire(&ctxt)); ++ ++ } while (!nbcon_context_enter_unsafe(&ctxt)); ++ ++ con->locked_port = true; ++} ++EXPORT_SYMBOL_GPL(nbcon_acquire); ++ ++/** ++ * nbcon_release - The first half of the port unlocking wrapper ++ * @up: The uart port whose @lock is about to be unlocked ++ * ++ * The uart_port_unlock() wrappers will first call this function to implement ++ * nbcon-specific processing. Then afterwards the uart_port_unlock() wrappers ++ * will unlock the spin_lock @up->lock. ++ * ++ * If @up is an nbcon console, the console will be marked as safe and ++ * released. Otherwise this function does nothing. ++ * ++ * nbcon consoles acquired via the port lock wrapper always use priority ++ * NBCON_PRIO_NORMAL. ++ */ ++void nbcon_release(struct uart_port *up) ++{ ++ struct console *con = up->cons; ++ struct nbcon_context ctxt = { ++ .console = con, ++ .prio = NBCON_PRIO_NORMAL, ++ }; ++ ++ if (!con->locked_port) ++ return; ++ ++ if (nbcon_context_exit_unsafe(&ctxt)) ++ nbcon_context_release(&ctxt); ++ ++ con->locked_port = false; ++} ++EXPORT_SYMBOL_GPL(nbcon_release); ++ ++/** ++ * printk_kthread_shutdown - shutdown all threaded printers ++ * ++ * On system shutdown all threaded printers are stopped. This allows printk ++ * to transition back to atomic printing, thus providing a robust mechanism ++ * for the final shutdown/reboot messages to be output. ++ */ ++static void printk_kthread_shutdown(void) ++{ ++ struct console *con; ++ ++ console_list_lock(); ++ for_each_console(con) { ++ if (con->flags & CON_NBCON) ++ nbcon_kthread_stop(con); ++ } ++ console_list_unlock(); ++} ++ ++static struct syscore_ops printk_syscore_ops = { ++ .shutdown = printk_kthread_shutdown, ++}; ++ ++static int __init printk_init_ops(void) ++{ ++ register_syscore_ops(&printk_syscore_ops); ++ return 0; ++} ++device_initcall(printk_init_ops); +diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c +index b4e390e0b..441cab825 100644 +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -102,12 +102,6 @@ DEFINE_STATIC_SRCU(console_srcu); + */ + int __read_mostly suppress_printk; + +-/* +- * During panic, heavy printk by other CPUs can delay the +- * panic and risk deadlock on console resources. +- */ +-static int __read_mostly suppress_panic_printk; +- + #ifdef CONFIG_LOCKDEP + static struct lockdep_map console_lock_dep_map = { + .name = "console_lock" +@@ -288,6 +282,7 @@ EXPORT_SYMBOL(console_list_unlock); + * Return: A cookie to pass to console_srcu_read_unlock(). + */ + int console_srcu_read_lock(void) ++ __acquires(&console_srcu) + { + return srcu_read_lock_nmisafe(&console_srcu); + } +@@ -301,6 +296,7 @@ EXPORT_SYMBOL(console_srcu_read_lock); + * Counterpart to console_srcu_read_lock() + */ + void console_srcu_read_unlock(int cookie) ++ __releases(&console_srcu) + { + srcu_read_unlock_nmisafe(&console_srcu, cookie); + } +@@ -353,6 +349,29 @@ static bool panic_in_progress(void) + return unlikely(atomic_read(&panic_cpu) != PANIC_CPU_INVALID); + } + ++/* Return true if a panic is in progress on the current CPU. */ ++bool this_cpu_in_panic(void) ++{ ++ /* ++ * We can use raw_smp_processor_id() here because it is impossible for ++ * the task to be migrated to the panic_cpu, or away from it. If ++ * panic_cpu has already been set, and we're not currently executing on ++ * that CPU, then we never will be. ++ */ ++ return unlikely(atomic_read(&panic_cpu) == raw_smp_processor_id()); ++} ++ ++/* ++ * Return true if a panic is in progress on a remote CPU. ++ * ++ * On true, the local CPU should immediately release any printing resources ++ * that may be needed by the panic CPU. ++ */ ++bool other_cpu_in_panic(void) ++{ ++ return (panic_in_progress() && !this_cpu_in_panic()); ++} ++ + /* + * This is used for debugging the mess that is the VT code by + * keeping track if we have the console semaphore held. It's +@@ -444,8 +463,33 @@ static int console_msg_format = MSG_FORMAT_DEFAULT; + /* syslog_lock protects syslog_* variables and write access to clear_seq. */ + static DEFINE_MUTEX(syslog_lock); + ++/* ++ * Specifies if a legacy console is registered. If legacy consoles are ++ * present, it is necessary to perform the console_lock/console_unlock dance ++ * whenever console flushing should occur. ++ */ ++bool have_legacy_console; ++ ++/* ++ * Specifies if an nbcon console is registered. If nbcon consoles are present, ++ * synchronous printing of legacy consoles will not occur during panic until ++ * the backtrace has been stored to the ringbuffer. ++ */ ++bool have_nbcon_console; ++ ++/* ++ * Specifies if a boot console is registered. If boot consoles are present, ++ * nbcon consoles cannot print simultaneously and must be synchronized by ++ * the console lock. This is because boot consoles and nbcon consoles may ++ * have mapped the same hardware. ++ */ ++bool have_boot_console; ++ + #ifdef CONFIG_PRINTK + DECLARE_WAIT_QUEUE_HEAD(log_wait); ++ ++static DECLARE_WAIT_QUEUE_HEAD(legacy_wait); ++ + /* All 3 protected by @syslog_lock. */ + /* the next printk record to read by syslog(READ) or /proc/kmsg */ + static u64 syslog_seq; +@@ -494,7 +538,7 @@ _DEFINE_PRINTKRB(printk_rb_static, CONFIG_LOG_BUF_SHIFT - PRB_AVGBITS, + + static struct printk_ringbuffer printk_rb_dynamic; + +-static struct printk_ringbuffer *prb = &printk_rb_static; ++struct printk_ringbuffer *prb = &printk_rb_static; + + /* + * We cannot access per-CPU data (e.g. per-CPU flush irq_work) before +@@ -698,9 +742,6 @@ static ssize_t msg_print_ext_body(char *buf, size_t size, + return len; + } + +-static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, +- bool is_extended, bool may_supress); +- + /* /dev/kmsg - userspace message inject/listen interface */ + struct devkmsg_user { + atomic64_t seq; +@@ -1848,7 +1889,7 @@ static bool console_waiter; + * there may be a waiter spinning (like a spinlock). Also it must be + * ready to hand over the lock at the end of the section. + */ +-static void console_lock_spinning_enable(void) ++void console_lock_spinning_enable(void) + { + /* + * Do not use spinning in panic(). The panic CPU wants to keep the lock. +@@ -1887,7 +1928,7 @@ static void console_lock_spinning_enable(void) + * + * Return: 1 if the lock rights were passed, 0 otherwise. + */ +-static int console_lock_spinning_disable_and_check(int cookie) ++int console_lock_spinning_disable_and_check(int cookie) + { + int waiter; + +@@ -2305,31 +2346,87 @@ int vprintk_store(int facility, int level, + return ret; + } + ++static bool legacy_allow_panic_sync; ++ ++/* ++ * This acts as a one-way switch to allow legacy consoles to print from ++ * the printk() caller context on a panic CPU. ++ */ ++void printk_legacy_allow_panic_sync(void) ++{ ++ legacy_allow_panic_sync = true; ++} ++ + asmlinkage int vprintk_emit(int facility, int level, + const struct dev_printk_info *dev_info, + const char *fmt, va_list args) + { ++ bool do_trylock_unlock = printing_via_unlock && ++ !IS_ENABLED(CONFIG_PREEMPT_RT); + int printed_len; +- bool in_sched = false; + + /* Suppress unimportant messages after panic happens */ + if (unlikely(suppress_printk)) + return 0; + +- if (unlikely(suppress_panic_printk) && other_cpu_in_panic()) ++ /* ++ * The messages on the panic CPU are the most important. If ++ * non-panic CPUs are generating any messages, they will be ++ * silently dropped. ++ */ ++ if (other_cpu_in_panic()) + return 0; + + if (level == LOGLEVEL_SCHED) { + level = LOGLEVEL_DEFAULT; +- in_sched = true; ++ /* If called from the scheduler, we can not call up(). */ ++ do_trylock_unlock = false; + } + + printk_delay(level); + + printed_len = vprintk_store(facility, level, dev_info, fmt, args); + +- /* If called from the scheduler, we can not call up(). */ +- if (!in_sched) { ++ if (!have_boot_console && have_nbcon_console) { ++ bool is_panic_context = this_cpu_in_panic(); ++ ++ /* ++ * In panic, the legacy consoles are not allowed to print from ++ * the printk calling context unless explicitly allowed. This ++ * gives the safe nbcon consoles a chance to print out all the ++ * panic messages first. This restriction only applies if ++ * there are nbcon consoles registered. ++ */ ++ if (is_panic_context) ++ do_trylock_unlock &= legacy_allow_panic_sync; ++ ++ /* ++ * There are situations where nbcon atomic printing should ++ * happen in the printk() caller context: ++ * ++ * - When this CPU is in panic. ++ * ++ * - When booting, before the printing threads have been ++ * started. ++ * ++ * - During shutdown, since the printing threads may not get ++ * a chance to print the final messages. ++ * ++ * Note that if boot consoles are registered, the ++ * console_lock/console_unlock dance must be relied upon ++ * instead because nbcon consoles cannot print simultaneously ++ * with boot consoles. ++ */ ++ if (is_panic_context || ++ !printk_threads_enabled || ++ (system_state > SYSTEM_RUNNING)) { ++ nbcon_atomic_flush_all(); ++ } ++ } ++ ++ nbcon_wake_threads(); ++ ++ if (do_trylock_unlock) { + /* + * The caller may be holding system-critical or + * timing-sensitive locks. Disable preemption during +@@ -2338,21 +2435,31 @@ asmlinkage int vprintk_emit(int facility, int level, + * another printk() caller will take over the printing. + */ + preempt_disable(); +- /* +- * Try to acquire and then immediately release the console +- * semaphore. The release will print out buffers. With the +- * spinning variant, this context tries to take over the +- * printing from another printing context. +- */ +- if (console_trylock_spinning()) +- console_unlock(); ++ /* ++ * Do not emit for EMERGENCY priority. The console will be ++ * explicitly flushed when exiting the emergency section. ++ */ ++ if (nbcon_get_default_prio() == NBCON_PRIO_EMERGENCY) { ++ do_trylock_unlock = false; ++ } else { ++ /* ++ * Try to acquire and then immediately release the ++ * console semaphore. The release will print out ++ * buffers. With the spinning variant, this context ++ * tries to take over the printing from another ++ * printing context. ++ */ ++ if (console_trylock_spinning()) ++ console_unlock(); ++ } ++ + preempt_enable(); + } + +- if (in_sched) +- defer_console_output(); ++ if (do_trylock_unlock) ++ wake_up_klogd(); + else +- wake_up_klogd(); ++ defer_console_output(); + + return printed_len; + } +@@ -2380,6 +2487,14 @@ EXPORT_SYMBOL(_printk); + static bool pr_flush(int timeout_ms, bool reset_on_progress); + static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress); + ++static struct task_struct *nbcon_legacy_kthread; ++ ++static inline void wake_up_legacy_kthread(void) ++{ ++ if (nbcon_legacy_kthread) ++ wake_up_interruptible(&legacy_wait); ++} ++ + #else /* CONFIG_PRINTK */ + + #define printk_time false +@@ -2390,25 +2505,11 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre + + static u64 syslog_seq; + +-static size_t record_print_text(const struct printk_record *r, +- bool syslog, bool time) +-{ +- return 0; +-} +-static ssize_t info_print_ext_header(char *buf, size_t size, +- struct printk_info *info) +-{ +- return 0; +-} +-static ssize_t msg_print_ext_body(char *buf, size_t size, +- char *text, size_t text_len, +- struct dev_printk_info *dev_info) { return 0; } +-static void console_lock_spinning_enable(void) { } +-static int console_lock_spinning_disable_and_check(int cookie) { return 0; } +-static bool suppress_message_printing(int level) { return false; } + static bool pr_flush(int timeout_ms, bool reset_on_progress) { return true; } + static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress) { return true; } + ++static inline void nbcon_legacy_kthread_create(void) { } ++static inline void wake_up_legacy_kthread(void) { } + #endif /* CONFIG_PRINTK */ + + #ifdef CONFIG_EARLY_PRINTK +@@ -2616,6 +2717,8 @@ void suspend_console(void) + void resume_console(void) + { + struct console *con; ++ short flags; ++ int cookie; + + if (!console_suspend_enabled) + return; +@@ -2632,6 +2735,20 @@ void resume_console(void) + */ + synchronize_srcu(&console_srcu); + ++ /* ++ * Since this runs in task context, wake the threaded printers ++ * directly rather than scheduling irq_work to do it. ++ */ ++ cookie = console_srcu_read_lock(); ++ for_each_console_srcu(con) { ++ flags = console_srcu_read_flags(con); ++ if (flags & CON_NBCON) ++ nbcon_kthread_wake(con); ++ } ++ console_srcu_read_unlock(cookie); ++ ++ wake_up_legacy_kthread(); ++ + pr_flush(1000, true); + } + +@@ -2646,7 +2763,8 @@ void resume_console(void) + */ + static int console_cpu_notify(unsigned int cpu) + { +- if (!cpuhp_tasks_frozen) { ++ if (!cpuhp_tasks_frozen && printing_via_unlock && ++ !IS_ENABLED(CONFIG_PREEMPT_RT)) { + /* If trylock fails, someone else is doing the printing */ + if (console_trylock()) + console_unlock(); +@@ -2654,26 +2772,6 @@ static int console_cpu_notify(unsigned int cpu) + return 0; + } + +-/* +- * Return true if a panic is in progress on a remote CPU. +- * +- * On true, the local CPU should immediately release any printing resources +- * that may be needed by the panic CPU. +- */ +-bool other_cpu_in_panic(void) +-{ +- if (!panic_in_progress()) +- return false; +- +- /* +- * We can use raw_smp_processor_id() here because it is impossible for +- * the task to be migrated to the panic_cpu, or away from it. If +- * panic_cpu has already been set, and we're not currently executing on +- * that CPU, then we never will be. +- */ +- return atomic_read(&panic_cpu) != raw_smp_processor_id(); +-} +- + /** + * console_lock - block the console subsystem from printing + * +@@ -2723,42 +2821,16 @@ int is_console_locked(void) + } + EXPORT_SYMBOL(is_console_locked); + +-/* +- * Check if the given console is currently capable and allowed to print +- * records. +- * +- * Requires the console_srcu_read_lock. +- */ +-static inline bool console_is_usable(struct console *con) +-{ +- short flags = console_srcu_read_flags(con); +- +- if (!(flags & CON_ENABLED)) +- return false; +- +- if ((flags & CON_SUSPENDED)) +- return false; +- +- if (!con->write) +- return false; +- +- /* +- * Console drivers may assume that per-cpu resources have been +- * allocated. So unless they're explicitly marked as being able to +- * cope (CON_ANYTIME) don't call them until this CPU is officially up. +- */ +- if (!cpu_online(raw_smp_processor_id()) && !(flags & CON_ANYTIME)) +- return false; +- +- return true; +-} +- + static void __console_unlock(void) + { + console_locked = 0; + up_console_sem(); + } + ++static DEFINE_WAIT_OVERRIDE_MAP(printk_legacy_map, LD_WAIT_SLEEP); ++ ++#ifdef CONFIG_PRINTK ++ + /* + * Prepend the message in @pmsg->pbufs->outbuf with a "dropped message". This + * is achieved by shifting the existing message over and inserting the dropped +@@ -2773,8 +2845,7 @@ static void __console_unlock(void) + * + * If @pmsg->pbufs->outbuf is modified, @pmsg->outbuf_len is updated. + */ +-#ifdef CONFIG_PRINTK +-static void console_prepend_dropped(struct printk_message *pmsg, unsigned long dropped) ++void console_prepend_dropped(struct printk_message *pmsg, unsigned long dropped) + { + struct printk_buffers *pbufs = pmsg->pbufs; + const size_t scratchbuf_sz = sizeof(pbufs->scratchbuf); +@@ -2805,9 +2876,6 @@ static void console_prepend_dropped(struct printk_message *pmsg, unsigned long d + memcpy(outbuf, scratchbuf, len); + pmsg->outbuf_len += len; + } +-#else +-#define console_prepend_dropped(pmsg, dropped) +-#endif /* CONFIG_PRINTK */ + + /* + * Read and format the specified record (or a later record if the specified +@@ -2828,11 +2896,9 @@ static void console_prepend_dropped(struct printk_message *pmsg, unsigned long d + * of @pmsg are valid. (See the documentation of struct printk_message + * for information about the @pmsg fields.) + */ +-static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, +- bool is_extended, bool may_suppress) ++bool printk_get_next_message(struct printk_message *pmsg, u64 seq, ++ bool is_extended, bool may_suppress) + { +- static int panic_console_dropped; +- + struct printk_buffers *pbufs = pmsg->pbufs; + const size_t scratchbuf_sz = sizeof(pbufs->scratchbuf); + const size_t outbuf_sz = sizeof(pbufs->outbuf); +@@ -2860,17 +2926,6 @@ static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, + pmsg->seq = r.info->seq; + pmsg->dropped = r.info->seq - seq; + +- /* +- * Check for dropped messages in panic here so that printk +- * suppression can occur as early as possible if necessary. +- */ +- if (pmsg->dropped && +- panic_in_progress() && +- panic_console_dropped++ > 10) { +- suppress_panic_printk = 1; +- pr_warn_once("Too many dropped messages. Suppress messages on non-panic CPUs to prevent livelock.\n"); +- } +- + /* Skip record that has level above the console loglevel. */ + if (may_suppress && suppress_message_printing(r.info->level)) + goto out; +@@ -2887,6 +2942,13 @@ static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, + return true; + } + ++/* ++ * Used as the printk buffers for non-panic, serialized console printing. ++ * This is for legacy (!CON_NBCON) as well as all boot (CON_BOOT) consoles. ++ * Its usage requires the console_lock held. ++ */ ++struct printk_buffers printk_shared_pbufs; ++ + /* + * Print one record for the given console. The record printed is whatever + * record is the next available record for the given console. +@@ -2904,12 +2966,10 @@ static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, + */ + static bool console_emit_next_record(struct console *con, bool *handover, int cookie) + { +- static struct printk_buffers pbufs; +- + bool is_extended = console_srcu_read_flags(con) & CON_EXTENDED; +- char *outbuf = &pbufs.outbuf[0]; ++ char *outbuf = &printk_shared_pbufs.outbuf[0]; + struct printk_message pmsg = { +- .pbufs = &pbufs, ++ .pbufs = &printk_shared_pbufs, + }; + unsigned long flags; + +@@ -2931,35 +2991,59 @@ static bool console_emit_next_record(struct console *con, bool *handover, int co + con->dropped = 0; + } + +- /* +- * While actively printing out messages, if another printk() +- * were to occur on another CPU, it may wait for this one to +- * finish. This task can not be preempted if there is a +- * waiter waiting to take over. +- * +- * Interrupts are disabled because the hand over to a waiter +- * must not be interrupted until the hand over is completed +- * (@console_waiter is cleared). +- */ +- printk_safe_enter_irqsave(flags); +- console_lock_spinning_enable(); ++ /* Write everything out to the hardware. */ + +- /* Do not trace print latency. */ +- stop_critical_timings(); ++ if (IS_ENABLED(CONFIG_PREEMPT_RT)) { ++ /* ++ * On PREEMPT_RT this function is either in a thread or ++ * panic context. So there is no need for concern about ++ * printk reentrance, handovers, or lockdep complaints. ++ */ + +- /* Write everything out to the hardware. */ +- con->write(con, outbuf, pmsg.outbuf_len); ++ con->write(con, outbuf, pmsg.outbuf_len); ++ con->seq = pmsg.seq + 1; ++ } else { ++ /* ++ * While actively printing out messages, if another printk() ++ * were to occur on another CPU, it may wait for this one to ++ * finish. This task can not be preempted if there is a ++ * waiter waiting to take over. ++ * ++ * Interrupts are disabled because the hand over to a waiter ++ * must not be interrupted until the hand over is completed ++ * (@console_waiter is cleared). ++ */ ++ printk_safe_enter_irqsave(flags); ++ console_lock_spinning_enable(); + +- start_critical_timings(); ++ /* Do not trace print latency. */ ++ stop_critical_timings(); + +- con->seq = pmsg.seq + 1; ++ lock_map_acquire_try(&printk_legacy_map); ++ con->write(con, outbuf, pmsg.outbuf_len); ++ lock_map_release(&printk_legacy_map); + +- *handover = console_lock_spinning_disable_and_check(cookie); +- printk_safe_exit_irqrestore(flags); ++ start_critical_timings(); ++ ++ con->seq = pmsg.seq + 1; ++ ++ *handover = console_lock_spinning_disable_and_check(cookie); ++ printk_safe_exit_irqrestore(flags); ++ } + skip: + return true; + } + ++#else ++ ++static bool console_emit_next_record(struct console *con, bool *handover, int cookie) ++{ ++ *handover = false; ++ return false; ++} ++ ++#endif /* CONFIG_PRINTK */ ++ + /* + * Print out all remaining records to all consoles. + * +@@ -2998,13 +3082,33 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove + + cookie = console_srcu_read_lock(); + for_each_console_srcu(con) { ++ short flags = console_srcu_read_flags(con); ++ u64 printk_seq; + bool progress; + +- if (!console_is_usable(con)) ++ /* ++ * console_flush_all() is only for legacy consoles, ++ * unless the nbcon console has no kthread printer. ++ */ ++ if ((flags & CON_NBCON) && con->kthread) ++ continue; ++ ++ if (!console_is_usable(con, flags, true)) + continue; + any_usable = true; + +- progress = console_emit_next_record(con, handover, cookie); ++ if (flags & CON_NBCON) { ++ ++ lock_map_acquire_try(&printk_legacy_map); ++ progress = nbcon_atomic_emit_next_record(con, handover, cookie); ++ lock_map_release(&printk_legacy_map); ++ ++ printk_seq = nbcon_seq_read(con); ++ } else { ++ progress = console_emit_next_record(con, handover, cookie); ++ ++ printk_seq = con->seq; ++ } + + /* + * If a handover has occurred, the SRCU read lock +@@ -3014,8 +3118,8 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove + return false; + + /* Track the next of the highest seq flushed. */ +- if (con->seq > *next_seq) +- *next_seq = con->seq; ++ if (printk_seq > *next_seq) ++ *next_seq = printk_seq; + + if (!progress) + continue; +@@ -3038,19 +3142,7 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove + return false; + } + +-/** +- * console_unlock - unblock the console subsystem from printing +- * +- * Releases the console_lock which the caller holds to block printing of +- * the console subsystem. +- * +- * While the console_lock was held, console output may have been buffered +- * by printk(). If this is the case, console_unlock(); emits +- * the output prior to releasing the lock. +- * +- * console_unlock(); may be called from any context. +- */ +-void console_unlock(void) ++static void console_flush_and_unlock(void) + { + bool do_cond_resched; + bool handover; +@@ -3094,6 +3186,32 @@ void console_unlock(void) + */ + } while (prb_read_valid(prb, next_seq, NULL) && console_trylock()); + } ++ ++/** ++ * console_unlock - unblock the console subsystem from printing ++ * ++ * Releases the console_lock which the caller holds to block printing of ++ * the console subsystem. ++ * ++ * While the console_lock was held, console output may have been buffered ++ * by printk(). If this is the case, console_unlock(); emits ++ * the output prior to releasing the lock. ++ * ++ * console_unlock(); may be called from any context. ++ */ ++void console_unlock(void) ++{ ++ /* ++ * PREEMPT_RT relies on kthread and atomic consoles for printing. ++ * It never attempts to print from console_unlock(). ++ */ ++ if (IS_ENABLED(CONFIG_PREEMPT_RT)) { ++ __console_unlock(); ++ return; ++ } ++ ++ console_flush_and_unlock(); ++} + EXPORT_SYMBOL(console_unlock); + + /** +@@ -3204,6 +3322,7 @@ void console_flush_on_panic(enum con_flush_mode mode) + + if (mode == CONSOLE_REPLAY_ALL) { + struct console *c; ++ short flags; + int cookie; + u64 seq; + +@@ -3211,16 +3330,25 @@ void console_flush_on_panic(enum con_flush_mode mode) + + cookie = console_srcu_read_lock(); + for_each_console_srcu(c) { +- /* +- * This is an unsynchronized assignment, but the +- * kernel is in "hope and pray" mode anyway. +- */ +- c->seq = seq; ++ flags = console_srcu_read_flags(c); ++ ++ if (flags & CON_NBCON) { ++ nbcon_seq_force(c, seq); ++ } else { ++ /* ++ * This is an unsynchronized assignment. On ++ * panic legacy consoles are only best effort. ++ */ ++ c->seq = seq; ++ } + } + console_srcu_read_unlock(cookie); + } + +- console_flush_all(false, &next_seq, &handover); ++ nbcon_atomic_flush_all(); ++ ++ if (printing_via_unlock) ++ console_flush_all(false, &next_seq, &handover); + } + + /* +@@ -3277,13 +3405,122 @@ EXPORT_SYMBOL(console_stop); + + void console_start(struct console *console) + { ++ short flags; ++ + console_list_lock(); + console_srcu_write_flags(console, console->flags | CON_ENABLED); ++ flags = console->flags; + console_list_unlock(); ++ ++ /* ++ * Ensure that all SRCU list walks have completed. The related ++ * printing context must be able to see it is enabled so that ++ * it is guaranteed to wake up and resume printing. ++ */ ++ synchronize_srcu(&console_srcu); ++ ++ if (flags & CON_NBCON) ++ nbcon_kthread_wake(console); ++ else ++ wake_up_legacy_kthread(); ++ + __pr_flush(console, 1000, true); + } + EXPORT_SYMBOL(console_start); + ++#ifdef CONFIG_PRINTK ++static bool printer_should_wake(void) ++{ ++ bool available = false; ++ struct console *con; ++ int cookie; ++ ++ if (kthread_should_stop()) ++ return true; ++ ++ cookie = console_srcu_read_lock(); ++ for_each_console_srcu(con) { ++ short flags = console_srcu_read_flags(con); ++ u64 printk_seq; ++ ++ /* ++ * The legacy printer thread is only for legacy consoles, ++ * unless the nbcon console has no kthread printer. ++ */ ++ if ((flags & CON_NBCON) && con->kthread) ++ continue; ++ ++ if (!console_is_usable(con, flags, true)) ++ continue; ++ ++ if (flags & CON_NBCON) { ++ printk_seq = nbcon_seq_read(con); ++ } else { ++ /* ++ * It is safe to read @seq because only this ++ * thread context updates @seq. ++ */ ++ printk_seq = con->seq; ++ } ++ ++ if (prb_read_valid(prb, printk_seq, NULL)) { ++ available = true; ++ break; ++ } ++ } ++ console_srcu_read_unlock(cookie); ++ ++ return available; ++} ++ ++static int nbcon_legacy_kthread_func(void *unused) ++{ ++ int error; ++ ++ for (;;) { ++ error = wait_event_interruptible(legacy_wait, printer_should_wake()); ++ ++ if (kthread_should_stop()) ++ break; ++ ++ if (error) ++ continue; ++ ++ console_lock(); ++ console_flush_and_unlock(); ++ } ++ ++ return 0; ++} ++ ++void nbcon_legacy_kthread_create(void) ++{ ++ struct task_struct *kt; ++ ++ lockdep_assert_held(&console_mutex); ++ ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ return; ++ ++ if (!printk_threads_enabled || nbcon_legacy_kthread) ++ return; ++ ++ kt = kthread_run(nbcon_legacy_kthread_func, NULL, "pr/legacy"); ++ if (IS_ERR(kt)) { ++ pr_err("unable to start legacy printing thread\n"); ++ return; ++ } ++ ++ nbcon_legacy_kthread = kt; ++ ++ /* ++ * It is important that console printing threads are scheduled ++ * shortly after a printk call and with generous runtime budgets. ++ */ ++ sched_set_normal(nbcon_legacy_kthread, -20); ++} ++#endif /* CONFIG_PRINTK */ ++ + static int __read_mostly keep_bootcon; + + static int __init keep_bootcon_setup(char *str) +@@ -3382,11 +3619,6 @@ static void try_enable_default_console(struct console *newcon) + newcon->flags |= CON_CONSDEV; + } + +-#define con_printk(lvl, con, fmt, ...) \ +- printk(lvl pr_fmt("%sconsole [%s%d] " fmt), \ +- (con->flags & CON_BOOT) ? "boot" : "", \ +- con->name, con->index, ##__VA_ARGS__) +- + static void console_init_seq(struct console *newcon, bool bootcon_registered) + { + struct console *con; +@@ -3435,11 +3667,20 @@ static void console_init_seq(struct console *newcon, bool bootcon_registered) + + newcon->seq = prb_next_seq(prb); + for_each_console(con) { +- if ((con->flags & CON_BOOT) && +- (con->flags & CON_ENABLED) && +- con->seq < newcon->seq) { +- newcon->seq = con->seq; ++ u64 seq; ++ ++ if (!((con->flags & CON_BOOT) && ++ (con->flags & CON_ENABLED))) { ++ continue; + } ++ ++ if (con->flags & CON_NBCON) ++ seq = nbcon_seq_read(con); ++ else ++ seq = con->seq; ++ ++ if (seq < newcon->seq) ++ newcon->seq = seq; + } + } + +@@ -3500,6 +3741,15 @@ void register_console(struct console *newcon) + goto unlock; + } + ++ if (newcon->flags & CON_NBCON) { ++ /* ++ * Ensure the nbcon console buffers can be allocated ++ * before modifying any global data. ++ */ ++ if (!nbcon_alloc(newcon)) ++ goto unlock; ++ } ++ + /* + * See if we want to enable this console driver by default. + * +@@ -3527,8 +3777,11 @@ void register_console(struct console *newcon) + err = try_enable_preferred_console(newcon, false); + + /* printk() messages are not printed to the Braille console. */ +- if (err || newcon->flags & CON_BRL) ++ if (err || newcon->flags & CON_BRL) { ++ if (newcon->flags & CON_NBCON) ++ nbcon_free(newcon); + goto unlock; ++ } + + /* + * If we have a bootconsole, and are switching to a real console, +@@ -3544,6 +3797,17 @@ void register_console(struct console *newcon) + newcon->dropped = 0; + console_init_seq(newcon, bootcon_registered); + ++ if (newcon->flags & CON_NBCON) { ++ have_nbcon_console = true; ++ nbcon_init(newcon); ++ } else { ++ have_legacy_console = true; ++ nbcon_legacy_kthread_create(); ++ } ++ ++ if (newcon->flags & CON_BOOT) ++ have_boot_console = true; ++ + /* + * Put this console in the list - keep the + * preferred driver at the head of the list. +@@ -3596,6 +3860,11 @@ EXPORT_SYMBOL(register_console); + /* Must be called under console_list_lock(). */ + static int unregister_console_locked(struct console *console) + { ++ bool is_boot_con = (console->flags & CON_BOOT); ++ bool found_legacy_con = false; ++ bool found_nbcon_con = false; ++ bool found_boot_con = false; ++ struct console *c; + int res; + + lockdep_assert_console_list_lock_held(); +@@ -3635,11 +3904,50 @@ static int unregister_console_locked(struct console *console) + */ + synchronize_srcu(&console_srcu); + ++ if (console->flags & CON_NBCON) ++ nbcon_free(console); ++ + console_sysfs_notify(); + + if (console->exit) + res = console->exit(console); + ++ /* ++ * With this console gone, the global flags tracking registered ++ * console types may have changed. Update them. ++ */ ++ for_each_console(c) { ++ if (c->flags & CON_BOOT) ++ found_boot_con = true; ++ ++ if (c->flags & CON_NBCON) ++ found_nbcon_con = true; ++ else ++ found_legacy_con = true; ++ } ++ if (!found_boot_con) ++ have_boot_console = false; ++ if (!found_legacy_con) ++ have_legacy_console = false; ++ if (!found_nbcon_con) ++ have_nbcon_console = false; ++ ++ /* ++ * When the last boot console unregisters, start up the ++ * printing threads. ++ */ ++ if (is_boot_con && !have_boot_console) { ++ for_each_console(c) ++ nbcon_kthread_create(c); ++ } ++ ++#ifdef CONFIG_PRINTK ++ if (!printing_via_unlock && nbcon_legacy_kthread) { ++ kthread_stop(nbcon_legacy_kthread); ++ nbcon_legacy_kthread = NULL; ++ } ++#endif ++ + return res; + } + +@@ -3784,69 +4092,94 @@ late_initcall(printk_late_init); + /* If @con is specified, only wait for that console. Otherwise wait for all. */ + static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress) + { +- int remaining = timeout_ms; ++ unsigned long timeout_jiffies = msecs_to_jiffies(timeout_ms); ++ unsigned long remaining_jiffies = timeout_jiffies; + struct console *c; + u64 last_diff = 0; + u64 printk_seq; ++ short flags; ++ bool locked; + int cookie; + u64 diff; + u64 seq; + + might_sleep(); + +- seq = prb_next_seq(prb); ++ seq = prb_next_reserve_seq(prb); + +- /* Flush the consoles so that records up to @seq are printed. */ +- console_lock(); +- console_unlock(); ++ /* ++ * Flush the consoles so that records up to @seq are printed. ++ * Otherwise this function will just wait for the threaded printers ++ * to print up to @seq. ++ */ ++ if (printing_via_unlock && !IS_ENABLED(CONFIG_PREEMPT_RT)) { ++ console_lock(); ++ console_unlock(); ++ } + + for (;;) { ++ unsigned long begin_jiffies; ++ unsigned long slept_jiffies; ++ ++ locked = false; + diff = 0; + +- /* +- * Hold the console_lock to guarantee safe access to +- * console->seq. Releasing console_lock flushes more +- * records in case @seq is still not printed on all +- * usable consoles. +- */ +- console_lock(); ++ if (printing_via_unlock) { ++ /* ++ * Hold the console_lock to guarantee safe access to ++ * console->seq. Releasing console_lock flushes more ++ * records in case @seq is still not printed on all ++ * usable consoles. ++ */ ++ console_lock(); ++ locked = true; ++ } + + cookie = console_srcu_read_lock(); + for_each_console_srcu(c) { + if (con && con != c) + continue; ++ ++ flags = console_srcu_read_flags(c); ++ + /* + * If consoles are not usable, it cannot be expected + * that they make forward progress, so only increment + * @diff for usable consoles. + */ +- if (!console_is_usable(c)) ++ if (!console_is_usable(c, flags, true) && ++ !console_is_usable(c, flags, false)) { + continue; +- printk_seq = c->seq; ++ } ++ ++ if (flags & CON_NBCON) { ++ printk_seq = nbcon_seq_read(c); ++ } else { ++ WARN_ON_ONCE(!locked); ++ printk_seq = c->seq; ++ } ++ + if (printk_seq < seq) + diff += seq - printk_seq; + } + console_srcu_read_unlock(cookie); + + if (diff != last_diff && reset_on_progress) +- remaining = timeout_ms; ++ remaining_jiffies = timeout_jiffies; + +- console_unlock(); ++ if (locked) ++ console_unlock(); + + /* Note: @diff is 0 if there are no usable consoles. */ +- if (diff == 0 || remaining == 0) ++ if (diff == 0 || remaining_jiffies == 0) + break; + +- if (remaining < 0) { +- /* no timeout limit */ +- msleep(100); +- } else if (remaining < 100) { +- msleep(remaining); +- remaining = 0; +- } else { +- msleep(100); +- remaining -= 100; +- } ++ /* msleep(1) might sleep much longer. Check time by jiffies. */ ++ begin_jiffies = jiffies; ++ msleep(1); ++ slept_jiffies = jiffies - begin_jiffies; ++ ++ remaining_jiffies -= min(slept_jiffies, remaining_jiffies); + + last_diff = diff; + } +@@ -3887,9 +4220,16 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work) + int pending = this_cpu_xchg(printk_pending, 0); + + if (pending & PRINTK_PENDING_OUTPUT) { +- /* If trylock fails, someone else is doing the printing */ +- if (console_trylock()) +- console_unlock(); ++ if (IS_ENABLED(CONFIG_PREEMPT_RT)) { ++ wake_up_interruptible(&legacy_wait); ++ } else { ++ /* ++ * If trylock fails, some other context ++ * will do the printing. ++ */ ++ if (console_trylock()) ++ console_unlock(); ++ } + } + + if (pending & PRINTK_PENDING_WAKEUP) +@@ -3957,11 +4297,16 @@ void defer_console_output(void) + * New messages may have been added directly to the ringbuffer + * using vprintk_store(), so wake any waiters as well. + */ +- __wake_up_klogd(PRINTK_PENDING_WAKEUP | PRINTK_PENDING_OUTPUT); ++ int val = PRINTK_PENDING_WAKEUP; ++ ++ if (printing_via_unlock) ++ val |= PRINTK_PENDING_OUTPUT; ++ __wake_up_klogd(val); + } + + void printk_trigger_flush(void) + { ++ nbcon_wake_threads(); + defer_console_output(); + } + +diff --git a/kernel/printk/printk_ringbuffer.c b/kernel/printk/printk_ringbuffer.c +index fde338606..e7b808b82 100644 +--- a/kernel/printk/printk_ringbuffer.c ++++ b/kernel/printk/printk_ringbuffer.c +@@ -6,6 +6,7 @@ + #include + #include + #include "printk_ringbuffer.h" ++#include "internal.h" + + /** + * DOC: printk_ringbuffer overview +@@ -303,6 +304,9 @@ + * + * desc_push_tail:B / desc_reserve:D + * set descriptor reusable (state), then push descriptor tail (id) ++ * ++ * desc_update_last_finalized:A / desc_last_finalized_seq:A ++ * store finalized record, then set new highest finalized sequence number + */ + + #define DATA_SIZE(data_ring) _DATA_SIZE((data_ring)->size_bits) +@@ -1030,9 +1034,13 @@ static char *data_alloc(struct printk_ringbuffer *rb, unsigned int size, + unsigned long next_lpos; + + if (size == 0) { +- /* Specify a data-less block. */ +- blk_lpos->begin = NO_LPOS; +- blk_lpos->next = NO_LPOS; ++ /* ++ * Data blocks are not created for empty lines. Instead, the ++ * reader will recognize these special lpos values and handle ++ * it appropriately. ++ */ ++ blk_lpos->begin = EMPTY_LINE_LPOS; ++ blk_lpos->next = EMPTY_LINE_LPOS; + return NULL; + } + +@@ -1210,10 +1218,18 @@ static const char *get_data(struct prb_data_ring *data_ring, + + /* Data-less data block description. */ + if (BLK_DATALESS(blk_lpos)) { +- if (blk_lpos->begin == NO_LPOS && blk_lpos->next == NO_LPOS) { ++ /* ++ * Records that are just empty lines are also valid, even ++ * though they do not have a data block. For such records ++ * explicitly return empty string data to signify success. ++ */ ++ if (blk_lpos->begin == EMPTY_LINE_LPOS && ++ blk_lpos->next == EMPTY_LINE_LPOS) { + *data_size = 0; + return ""; + } ++ ++ /* Data lost, invalid, or otherwise unavailable. */ + return NULL; + } + +@@ -1441,20 +1457,118 @@ bool prb_reserve_in_last(struct prb_reserved_entry *e, struct printk_ringbuffer + return false; + } + ++/* ++ * @last_finalized_seq value guarantees that all records up to and including ++ * this sequence number are finalized and can be read. The only exception are ++ * too old records which have already been overwritten. ++ * ++ * It is also guaranteed that @last_finalized_seq only increases. ++ * ++ * Be aware that finalized records following non-finalized records are not ++ * reported because they are not yet available to the reader. For example, ++ * a new record stored via printk() will not be available to a printer if ++ * it follows a record that has not been finalized yet. However, once that ++ * non-finalized record becomes finalized, @last_finalized_seq will be ++ * appropriately updated and the full set of finalized records will be ++ * available to the printer. And since each printk() caller will either ++ * directly print or trigger deferred printing of all available unprinted ++ * records, all printk() messages will get printed. ++ */ ++static u64 desc_last_finalized_seq(struct printk_ringbuffer *rb) ++{ ++ struct prb_desc_ring *desc_ring = &rb->desc_ring; ++ unsigned long ulseq; ++ ++ /* ++ * Guarantee the sequence number is loaded before loading the ++ * associated record in order to guarantee that the record can be ++ * seen by this CPU. This pairs with desc_update_last_finalized:A. ++ */ ++ ulseq = atomic_long_read_acquire(&desc_ring->last_finalized_seq ++ ); /* LMM(desc_last_finalized_seq:A) */ ++ ++ return __ulseq_to_u64seq(rb, ulseq); ++} ++ ++static bool _prb_read_valid(struct printk_ringbuffer *rb, u64 *seq, ++ struct printk_record *r, unsigned int *line_count); ++ ++/* ++ * Check if there are records directly following @last_finalized_seq that are ++ * finalized. If so, update @last_finalized_seq to the latest of these ++ * records. It is not allowed to skip over records that are not yet finalized. ++ */ ++static void desc_update_last_finalized(struct printk_ringbuffer *rb) ++{ ++ struct prb_desc_ring *desc_ring = &rb->desc_ring; ++ u64 old_seq = desc_last_finalized_seq(rb); ++ unsigned long oldval; ++ unsigned long newval; ++ u64 finalized_seq; ++ u64 try_seq; ++ ++try_again: ++ finalized_seq = old_seq; ++ try_seq = finalized_seq + 1; ++ ++ /* Try to find later finalized records. */ ++ while (_prb_read_valid(rb, &try_seq, NULL, NULL)) { ++ finalized_seq = try_seq; ++ try_seq++; ++ } ++ ++ /* No update needed if no later finalized record was found. */ ++ if (finalized_seq == old_seq) ++ return; ++ ++ oldval = __u64seq_to_ulseq(old_seq); ++ newval = __u64seq_to_ulseq(finalized_seq); ++ ++ /* ++ * Set the sequence number of a later finalized record that has been ++ * seen. ++ * ++ * Guarantee the record data is visible to other CPUs before storing ++ * its sequence number. This pairs with desc_last_finalized_seq:A. ++ * ++ * Memory barrier involvement: ++ * ++ * If desc_last_finalized_seq:A reads from ++ * desc_update_last_finalized:A, then desc_read:A reads from ++ * _prb_commit:B. ++ * ++ * Relies on: ++ * ++ * RELEASE from _prb_commit:B to desc_update_last_finalized:A ++ * matching ++ * ACQUIRE from desc_last_finalized_seq:A to desc_read:A ++ * ++ * Note: _prb_commit:B and desc_update_last_finalized:A can be ++ * different CPUs. However, the desc_update_last_finalized:A ++ * CPU (which performs the release) must have previously seen ++ * _prb_commit:B. ++ */ ++ if (!atomic_long_try_cmpxchg_release(&desc_ring->last_finalized_seq, ++ &oldval, newval)) { /* LMM(desc_update_last_finalized:A) */ ++ old_seq = __ulseq_to_u64seq(rb, oldval); ++ goto try_again; ++ } ++} ++ + /* + * Attempt to finalize a specified descriptor. If this fails, the descriptor + * is either already final or it will finalize itself when the writer commits. + */ +-static void desc_make_final(struct prb_desc_ring *desc_ring, unsigned long id) ++static void desc_make_final(struct printk_ringbuffer *rb, unsigned long id) + { ++ struct prb_desc_ring *desc_ring = &rb->desc_ring; + unsigned long prev_state_val = DESC_SV(id, desc_committed); + struct prb_desc *d = to_desc(desc_ring, id); + +- atomic_long_cmpxchg_relaxed(&d->state_var, prev_state_val, +- DESC_SV(id, desc_finalized)); /* LMM(desc_make_final:A) */ +- +- /* Best effort to remember the last finalized @id. */ +- atomic_long_set(&desc_ring->last_finalized_id, id); ++ if (atomic_long_try_cmpxchg_relaxed(&d->state_var, &prev_state_val, ++ DESC_SV(id, desc_finalized))) { /* LMM(desc_make_final:A) */ ++ desc_update_last_finalized(rb); ++ } + } + + /** +@@ -1550,7 +1664,7 @@ bool prb_reserve(struct prb_reserved_entry *e, struct printk_ringbuffer *rb, + * readers. (For seq==0 there is no previous descriptor.) + */ + if (info->seq > 0) +- desc_make_final(desc_ring, DESC_ID(id - 1)); ++ desc_make_final(rb, DESC_ID(id - 1)); + + r->text_buf = data_alloc(rb, r->text_buf_size, &d->text_blk_lpos, id); + /* If text data allocation fails, a data-less record is committed. */ +@@ -1643,7 +1757,7 @@ void prb_commit(struct prb_reserved_entry *e) + */ + head_id = atomic_long_read(&desc_ring->head_id); /* LMM(prb_commit:A) */ + if (head_id != e->id) +- desc_make_final(desc_ring, e->id); ++ desc_make_final(e->rb, e->id); + } + + /** +@@ -1663,12 +1777,9 @@ void prb_commit(struct prb_reserved_entry *e) + */ + void prb_final_commit(struct prb_reserved_entry *e) + { +- struct prb_desc_ring *desc_ring = &e->rb->desc_ring; +- + _prb_commit(e, desc_finalized); + +- /* Best effort to remember the last finalized @id. */ +- atomic_long_set(&desc_ring->last_finalized_id, e->id); ++ desc_update_last_finalized(e->rb); + } + + /* +@@ -1746,6 +1857,8 @@ static bool copy_data(struct prb_data_ring *data_ring, + * descriptor. However, it also verifies that the record is finalized and has + * the sequence number @seq. On success, 0 is returned. + * ++ * For the panic CPU, committed descriptors are also considered finalized. ++ * + * Error return values: + * -EINVAL: A finalized record with sequence number @seq does not exist. + * -ENOENT: A finalized record with sequence number @seq exists, but its data +@@ -1764,16 +1877,25 @@ static int desc_read_finalized_seq(struct prb_desc_ring *desc_ring, + + /* + * An unexpected @id (desc_miss) or @seq mismatch means the record +- * does not exist. A descriptor in the reserved or committed state +- * means the record does not yet exist for the reader. ++ * does not exist. A descriptor in the reserved state means the ++ * record does not yet exist for the reader. + */ + if (d_state == desc_miss || + d_state == desc_reserved || +- d_state == desc_committed || + s != seq) { + return -EINVAL; + } + ++ /* ++ * A descriptor in the committed state means the record does not yet ++ * exist for the reader. However, for the panic CPU, committed ++ * records are also handled as finalized records since they contain ++ * message data in a consistent state and may contain additional ++ * hints as to the cause of the panic. ++ */ ++ if (d_state == desc_committed && !this_cpu_in_panic()) ++ return -EINVAL; ++ + /* + * A descriptor in the reusable state may no longer have its data + * available; report it as existing but with lost data. Or the record +@@ -1832,7 +1954,7 @@ static int prb_read(struct printk_ringbuffer *rb, u64 seq, + } + + /* Get the sequence number of the tail descriptor. */ +-static u64 prb_first_seq(struct printk_ringbuffer *rb) ++u64 prb_first_seq(struct printk_ringbuffer *rb) + { + struct prb_desc_ring *desc_ring = &rb->desc_ring; + enum desc_state d_state; +@@ -1875,12 +1997,131 @@ static u64 prb_first_seq(struct printk_ringbuffer *rb) + return seq; + } + ++/** ++ * prb_next_reserve_seq() - Get the sequence number after the most recently ++ * reserved record. ++ * ++ * @rb: The ringbuffer to get the sequence number from. ++ * ++ * This is the public function available to readers to see what sequence ++ * number will be assigned to the next reserved record. ++ * ++ * Note that depending on the situation, this value can be equal to or ++ * higher than the sequence number returned by prb_next_seq(). ++ * ++ * Context: Any context. ++ * Return: The sequence number that will be assigned to the next record ++ * reserved. ++ */ ++u64 prb_next_reserve_seq(struct printk_ringbuffer *rb) ++{ ++ struct prb_desc_ring *desc_ring = &rb->desc_ring; ++ unsigned long last_finalized_id; ++ atomic_long_t *state_var; ++ u64 last_finalized_seq; ++ unsigned long head_id; ++ struct prb_desc desc; ++ unsigned long diff; ++ struct prb_desc *d; ++ int err; ++ ++ /* ++ * It may not be possible to read a sequence number for @head_id. ++ * So the ID of @last_finailzed_seq is used to calculate what the ++ * sequence number of @head_id will be. ++ */ ++ ++try_again: ++ last_finalized_seq = desc_last_finalized_seq(rb); ++ ++ /* ++ * @head_id is loaded after @last_finalized_seq to ensure that it is ++ * at or beyond @last_finalized_seq. ++ * ++ * Memory barrier involvement: ++ * ++ * If desc_last_finalized_seq:A reads from ++ * desc_update_last_finalized:A, then ++ * prb_next_reserve_seq:A reads from desc_reserve:D. ++ * ++ * Relies on: ++ * ++ * RELEASE from desc_reserve:D to desc_update_last_finalized:A ++ * matching ++ * ACQUIRE from desc_last_finalized_seq:A to prb_next_reserve_seq:A ++ * ++ * Note: desc_reserve:D and desc_update_last_finalized:A can be ++ * different CPUs. However, the desc_update_last_finalized:A CPU ++ * (which performs the release) must have previously seen ++ * desc_read:C, which implies desc_reserve:D can be seen. ++ */ ++ head_id = atomic_long_read(&desc_ring->head_id); /* LMM(prb_next_reserve_seq:A) */ ++ ++ d = to_desc(desc_ring, last_finalized_seq); ++ state_var = &d->state_var; ++ ++ /* Extract the ID, used to specify the descriptor to read. */ ++ last_finalized_id = DESC_ID(atomic_long_read(state_var)); ++ ++ /* Ensure @last_finalized_id is correct. */ ++ err = desc_read_finalized_seq(desc_ring, last_finalized_id, last_finalized_seq, &desc); ++ ++ if (err == -EINVAL) { ++ if (last_finalized_seq == 0) { ++ /* ++ * @last_finalized_seq still contains its initial ++ * value. Probably no record has been finalized yet. ++ * This means the ringbuffer is not yet full and the ++ * @head_id value can be used directly (subtracting ++ * off the id value corresponding to seq=0). ++ */ ++ ++ /* ++ * Because of hack#2 of the bootstrapping phase, the ++ * @head_id initial value must be handled separately. ++ */ ++ if (head_id == DESC0_ID(desc_ring->count_bits)) ++ return 0; ++ ++ /* ++ * The @head_id is initialized such that the first ++ * increment will yield the first record (seq=0). ++ * Therefore use the initial value +1 as the base to ++ * subtract from @head_id. ++ */ ++ last_finalized_id = DESC0_ID(desc_ring->count_bits) + 1; ++ } else { ++ /* Record must have been overwritten. Try again. */ ++ goto try_again; ++ } ++ } ++ ++ /* ++ * @diff is the number of records beyond the last record available ++ * to readers. ++ */ ++ diff = head_id - last_finalized_id; ++ ++ /* ++ * @head_id points to the most recently reserved record, but this ++ * function returns the sequence number that will be assigned to the ++ * next (not yet reserved) record. Thus +1 is needed. ++ */ ++ return (last_finalized_seq + diff + 1); ++} ++ + /* +- * Non-blocking read of a record. Updates @seq to the last finalized record +- * (which may have no data available). ++ * Non-blocking read of a record. + * +- * See the description of prb_read_valid() and prb_read_valid_info() +- * for details. ++ * On success @seq is updated to the record that was read and (if provided) ++ * @r and @line_count will contain the read/calculated data. ++ * ++ * On failure @seq is updated to a record that is not yet available to the ++ * reader, but it will be the next record available to the reader. ++ * ++ * Note: When the current CPU is in panic, this function will skip over any ++ * non-existent/non-finalized records in order to allow the panic CPU ++ * to print any and all records that have been finalized. + */ + static bool _prb_read_valid(struct printk_ringbuffer *rb, u64 *seq, + struct printk_record *r, unsigned int *line_count) +@@ -1899,12 +2140,32 @@ static bool _prb_read_valid(struct printk_ringbuffer *rb, u64 *seq, + *seq = tail_seq; + + } else if (err == -ENOENT) { +- /* Record exists, but no data available. Skip. */ ++ /* Record exists, but the data was lost. Skip. */ + (*seq)++; + + } else { +- /* Non-existent/non-finalized record. Must stop. */ +- return false; ++ /* ++ * Non-existent/non-finalized record. Must stop. ++ * ++ * For panic situations it cannot be expected that ++ * non-finalized records will become finalized. But ++ * there may be other finalized records beyond that ++ * need to be printed for a panic situation. If this ++ * is the panic CPU, skip this ++ * non-existent/non-finalized record unless it is ++ * at or beyond the head, in which case it is not ++ * possible to continue. ++ * ++ * Note that new messages printed on panic CPU are ++ * finalized when we are here. The only exception ++ * might be the last message without trailing newline. ++ * But it would have the sequence number returned ++ * by "prb_next_reserve_seq() - 1". ++ */ ++ if (this_cpu_in_panic() && ((*seq + 1) < prb_next_reserve_seq(rb))) ++ (*seq)++; ++ else ++ return false; + } + } + +@@ -1932,7 +2193,7 @@ static bool _prb_read_valid(struct printk_ringbuffer *rb, u64 *seq, + * On success, the reader must check r->info.seq to see which record was + * actually read. This allows the reader to detect dropped records. + * +- * Failure means @seq refers to a not yet written record. ++ * Failure means @seq refers to a record not yet available to the reader. + */ + bool prb_read_valid(struct printk_ringbuffer *rb, u64 seq, + struct printk_record *r) +@@ -1962,7 +2223,7 @@ bool prb_read_valid(struct printk_ringbuffer *rb, u64 seq, + * On success, the reader must check info->seq to see which record meta data + * was actually read. This allows the reader to detect dropped records. + * +- * Failure means @seq refers to a not yet written record. ++ * Failure means @seq refers to a record not yet available to the reader. + */ + bool prb_read_valid_info(struct printk_ringbuffer *rb, u64 seq, + struct printk_info *info, unsigned int *line_count) +@@ -2008,7 +2269,9 @@ u64 prb_first_valid_seq(struct printk_ringbuffer *rb) + * newest sequence number available to readers will be. + * + * This provides readers a sequence number to jump to if all currently +- * available records should be skipped. ++ * available records should be skipped. It is guaranteed that all records ++ * previous to the returned value have been finalized and are (or were) ++ * available to the reader. + * + * Context: Any context. + * Return: The sequence number of the next newest (not yet available) record +@@ -2016,34 +2279,19 @@ u64 prb_first_valid_seq(struct printk_ringbuffer *rb) + */ + u64 prb_next_seq(struct printk_ringbuffer *rb) + { +- struct prb_desc_ring *desc_ring = &rb->desc_ring; +- enum desc_state d_state; +- unsigned long id; + u64 seq; + +- /* Check if the cached @id still points to a valid @seq. */ +- id = atomic_long_read(&desc_ring->last_finalized_id); +- d_state = desc_read(desc_ring, id, NULL, &seq, NULL); ++ seq = desc_last_finalized_seq(rb); + +- if (d_state == desc_finalized || d_state == desc_reusable) { +- /* +- * Begin searching after the last finalized record. +- * +- * On 0, the search must begin at 0 because of hack#2 +- * of the bootstrapping phase it is not known if a +- * record at index 0 exists. +- */ +- if (seq != 0) +- seq++; +- } else { +- /* +- * The information about the last finalized sequence number +- * has gone. It should happen only when there is a flood of +- * new messages and the ringbuffer is rapidly recycled. +- * Give up and start from the beginning. +- */ +- seq = 0; +- } ++ /* ++ * Begin searching after the last finalized record. ++ * ++ * On 0, the search must begin at 0 because of hack#2 ++ * of the bootstrapping phase it is not known if a ++ * record at index 0 exists. ++ */ ++ if (seq != 0) ++ seq++; + + /* + * The information about the last finalized @seq might be inaccurate. +@@ -2085,7 +2333,7 @@ void prb_init(struct printk_ringbuffer *rb, + rb->desc_ring.infos = infos; + atomic_long_set(&rb->desc_ring.head_id, DESC0_ID(descbits)); + atomic_long_set(&rb->desc_ring.tail_id, DESC0_ID(descbits)); +- atomic_long_set(&rb->desc_ring.last_finalized_id, DESC0_ID(descbits)); ++ atomic_long_set(&rb->desc_ring.last_finalized_seq, 0); + + rb->text_data_ring.size_bits = textbits; + rb->text_data_ring.data = text_buf; +diff --git a/kernel/printk/printk_ringbuffer.h b/kernel/printk/printk_ringbuffer.h +index 18cd25e48..52626d0f1 100644 +--- a/kernel/printk/printk_ringbuffer.h ++++ b/kernel/printk/printk_ringbuffer.h +@@ -75,7 +75,7 @@ struct prb_desc_ring { + struct printk_info *infos; + atomic_long_t head_id; + atomic_long_t tail_id; +- atomic_long_t last_finalized_id; ++ atomic_long_t last_finalized_seq; + }; + + /* +@@ -127,8 +127,22 @@ enum desc_state { + #define DESC_SV(id, state) (((unsigned long)state << DESC_FLAGS_SHIFT) | id) + #define DESC_ID_MASK (~DESC_FLAGS_MASK) + #define DESC_ID(sv) ((sv) & DESC_ID_MASK) ++ ++/* ++ * Special data block logical position values (for fields of ++ * @prb_desc.text_blk_lpos). ++ * ++ * - Bit0 is used to identify if the record has no data block. (Implemented in ++ * the LPOS_DATALESS() macro.) ++ * ++ * - Bit1 specifies the reason for not having a data block. ++ * ++ * These special values could never be real lpos values because of the ++ * meta data and alignment padding of data blocks. (See to_blk_size() for ++ * details.) ++ */ + #define FAILED_LPOS 0x1 +-#define NO_LPOS 0x3 ++#define EMPTY_LINE_LPOS 0x3 + + #define FAILED_BLK_LPOS \ + { \ +@@ -259,7 +273,7 @@ static struct printk_ringbuffer name = { \ + .infos = &_##name##_infos[0], \ + .head_id = ATOMIC_INIT(DESC0_ID(descbits)), \ + .tail_id = ATOMIC_INIT(DESC0_ID(descbits)), \ +- .last_finalized_id = ATOMIC_INIT(DESC0_ID(descbits)), \ ++ .last_finalized_seq = ATOMIC_INIT(0), \ + }, \ + .text_data_ring = { \ + .size_bits = (avgtextbits) + (descbits), \ +@@ -378,7 +392,41 @@ bool prb_read_valid(struct printk_ringbuffer *rb, u64 seq, + bool prb_read_valid_info(struct printk_ringbuffer *rb, u64 seq, + struct printk_info *info, unsigned int *line_count); + ++u64 prb_first_seq(struct printk_ringbuffer *rb); + u64 prb_first_valid_seq(struct printk_ringbuffer *rb); + u64 prb_next_seq(struct printk_ringbuffer *rb); ++u64 prb_next_reserve_seq(struct printk_ringbuffer *rb); ++ ++#ifdef CONFIG_64BIT ++ ++#define __u64seq_to_ulseq(u64seq) (u64seq) ++#define __ulseq_to_u64seq(rb, ulseq) (ulseq) ++ ++#else /* CONFIG_64BIT */ ++ ++#define __u64seq_to_ulseq(u64seq) ((u32)u64seq) ++ ++static inline u64 __ulseq_to_u64seq(struct printk_ringbuffer *rb, u32 ulseq) ++{ ++ u64 rb_first_seq = prb_first_seq(rb); ++ u64 seq; ++ ++ /* ++ * The provided sequence is only the lower 32 bits of the ringbuffer ++ * sequence. It needs to be expanded to 64bit. Get the first sequence ++ * number from the ringbuffer and fold it. ++ * ++ * Having a 32bit representation in the console is sufficient. ++ * If a console ever gets more than 2^31 records behind ++ * the ringbuffer then this is the least of the problems. ++ * ++ * Also the access to the ring buffer is always safe. ++ */ ++ seq = rb_first_seq - (s32)((u32)rb_first_seq - ulseq); ++ ++ return seq; ++} ++ ++#endif /* CONFIG_64BIT */ + + #endif /* _KERNEL_PRINTK_RINGBUFFER_H */ +diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c +index 6d10927a0..8d9408d65 100644 +--- a/kernel/printk/printk_safe.c ++++ b/kernel/printk/printk_safe.c +@@ -26,6 +26,18 @@ void __printk_safe_exit(void) + this_cpu_dec(printk_context); + } + ++void __printk_deferred_enter(void) ++{ ++ cant_migrate(); ++ this_cpu_inc(printk_context); ++} ++ ++void __printk_deferred_exit(void) ++{ ++ cant_migrate(); ++ this_cpu_dec(printk_context); ++} ++ + asmlinkage int vprintk(const char *fmt, va_list args) + { + #ifdef CONFIG_KGDB_KDB +diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c +index ade42d6a9..eebb9b454 100644 +--- a/kernel/rcu/rcutorture.c ++++ b/kernel/rcu/rcutorture.c +@@ -2408,6 +2408,12 @@ static int rcutorture_booster_init(unsigned int cpu) + WARN_ON_ONCE(!t); + sp.sched_priority = 2; + sched_setscheduler_nocheck(t, SCHED_FIFO, &sp); ++#ifdef CONFIG_PREEMPT_RT ++ t = per_cpu(timersd, cpu); ++ WARN_ON_ONCE(!t); ++ sp.sched_priority = 2; ++ sched_setscheduler_nocheck(t, SCHED_FIFO, &sp); ++#endif + } + + /* Don't allow time recalculation while creating a new task. */ +diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h +index e09f4f624..311483048 100644 +--- a/kernel/rcu/tree_stall.h ++++ b/kernel/rcu/tree_stall.h +@@ -8,6 +8,7 @@ + */ + + #include ++#include + + ////////////////////////////////////////////////////////////////////////////// + // +@@ -603,6 +604,8 @@ static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps) + if (rcu_stall_is_suppressed()) + return; + ++ nbcon_cpu_emergency_enter(); ++ + /* + * OK, time to rat on our buddy... + * See Documentation/RCU/stallwarn.rst for info on how to debug +@@ -657,6 +660,8 @@ static void print_other_cpu_stall(unsigned long gp_seq, unsigned long gps) + panic_on_rcu_stall(); + + rcu_force_quiescent_state(); /* Kick them all. */ ++ ++ nbcon_cpu_emergency_exit(); + } + + static void print_cpu_stall(unsigned long gps) +diff --git a/kernel/sched/core.c b/kernel/sched/core.c +index 07bcc5f2e..7a6b82e1f 100644 +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -901,14 +901,15 @@ static inline void hrtick_rq_init(struct rq *rq) + + #if defined(CONFIG_SMP) && defined(TIF_POLLING_NRFLAG) + /* +- * Atomically set TIF_NEED_RESCHED and test for TIF_POLLING_NRFLAG, ++ * Atomically set TIF_NEED_RESCHED[_LAZY] and test for TIF_POLLING_NRFLAG, + * this avoids any races wrt polling state changes and thereby avoids + * spurious IPIs. + */ +-static inline bool set_nr_and_not_polling(struct task_struct *p) ++static inline bool set_nr_and_not_polling(struct task_struct *p, int tif_bit) + { + struct thread_info *ti = task_thread_info(p); +- return !(fetch_or(&ti->flags, _TIF_NEED_RESCHED) & _TIF_POLLING_NRFLAG); ++ ++ return !(fetch_or(&ti->flags, 1 << tif_bit) & _TIF_POLLING_NRFLAG); + } + + /* +@@ -925,7 +926,7 @@ static bool set_nr_if_polling(struct task_struct *p) + for (;;) { + if (!(val & _TIF_POLLING_NRFLAG)) + return false; +- if (val & _TIF_NEED_RESCHED) ++ if (val & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY)) + return true; + if (try_cmpxchg(&ti->flags, &val, val | _TIF_NEED_RESCHED)) + break; +@@ -934,9 +935,9 @@ static bool set_nr_if_polling(struct task_struct *p) + } + + #else +-static inline bool set_nr_and_not_polling(struct task_struct *p) ++static inline bool set_nr_and_not_polling(struct task_struct *p, int tif_bit) + { +- set_tsk_need_resched(p); ++ set_tsk_thread_flag(p, tif_bit); + return true; + } + +@@ -1041,28 +1042,47 @@ void wake_up_q(struct wake_q_head *head) + * might also involve a cross-CPU call to trigger the scheduler on + * the target CPU. + */ +-void resched_curr(struct rq *rq) ++static void __resched_curr(struct rq *rq, int lazy) + { ++ int cpu, tif_bit = TIF_NEED_RESCHED + lazy; + struct task_struct *curr = rq->curr; +- int cpu; + + lockdep_assert_rq_held(rq); + +- if (test_tsk_need_resched(curr)) ++ if (unlikely(test_tsk_thread_flag(curr, tif_bit))) + return; + + cpu = cpu_of(rq); + + if (cpu == smp_processor_id()) { +- set_tsk_need_resched(curr); +- set_preempt_need_resched(); ++ set_tsk_thread_flag(curr, tif_bit); ++ if (!lazy) ++ set_preempt_need_resched(); + return; + } + +- if (set_nr_and_not_polling(curr)) +- smp_send_reschedule(cpu); +- else ++ if (set_nr_and_not_polling(curr, tif_bit)) { ++ if (!lazy) ++ smp_send_reschedule(cpu); ++ } else { + trace_sched_wake_idle_without_ipi(cpu); ++ } ++} ++ ++void resched_curr(struct rq *rq) ++{ ++ __resched_curr(rq, 0); ++} ++ ++void resched_curr_lazy(struct rq *rq) ++{ ++ int lazy = IS_ENABLED(CONFIG_PREEMPT_BUILD_AUTO) && !sched_feat(FORCE_NEED_RESCHED) ? ++ TIF_NEED_RESCHED_LAZY_OFFSET : 0; ++ ++ if (lazy && unlikely(test_tsk_thread_flag(rq->curr, TIF_NEED_RESCHED))) ++ return; ++ ++ __resched_curr(rq, lazy); + } + + void resched_cpu(int cpu) +@@ -1135,7 +1155,7 @@ static void wake_up_idle_cpu(int cpu) + if (cpu == smp_processor_id()) + return; + +- if (set_nr_and_not_polling(rq->idle)) ++ if (set_nr_and_not_polling(rq->idle, TIF_NEED_RESCHED)) + smp_send_reschedule(cpu); + else + trace_sched_wake_idle_without_ipi(cpu); +@@ -6777,10 +6797,14 @@ void __noreturn do_task_dead(void) + + static inline void sched_submit_work(struct task_struct *tsk) + { ++ static DEFINE_WAIT_OVERRIDE_MAP(sched_map, LD_WAIT_CONFIG); + unsigned int task_flags; + +- if (task_is_running(tsk)) +- return; ++ /* ++ * Establish LD_WAIT_CONFIG context to ensure none of the code called ++ * will use a blocking primitive -- which would lead to recursion. ++ */ ++ lock_map_acquire_try(&sched_map); + + task_flags = tsk->flags; + /* +@@ -6806,6 +6830,8 @@ static inline void sched_submit_work(struct task_struct *tsk) + * make sure to submit it to avoid deadlocks. + */ + blk_flush_plug(tsk->plug, true); ++ ++ lock_map_release(&sched_map); + } + + static void sched_update_worker(struct task_struct *tsk) +@@ -6818,16 +6844,26 @@ static void sched_update_worker(struct task_struct *tsk) + } + } + +-asmlinkage __visible void __sched schedule(void) ++static __always_inline void __schedule_loop(unsigned int sched_mode) + { +- struct task_struct *tsk = current; +- +- sched_submit_work(tsk); + do { + preempt_disable(); +- __schedule(SM_NONE); ++ __schedule(sched_mode); + sched_preempt_enable_no_resched(); + } while (need_resched()); ++} ++ ++asmlinkage __visible void __sched schedule(void) ++{ ++ struct task_struct *tsk = current; ++ ++#ifdef CONFIG_RT_MUTEXES ++ lockdep_assert(!tsk->sched_rt_mutex); ++#endif ++ ++ if (!task_is_running(tsk)) ++ sched_submit_work(tsk); ++ __schedule_loop(SM_NONE); + sched_update_worker(tsk); + } + EXPORT_SYMBOL(schedule); +@@ -6891,11 +6927,7 @@ void __sched schedule_preempt_disabled(void) + #ifdef CONFIG_PREEMPT_RT + void __sched notrace schedule_rtlock(void) + { +- do { +- preempt_disable(); +- __schedule(SM_RTLOCK_WAIT); +- sched_preempt_enable_no_resched(); +- } while (need_resched()); ++ __schedule_loop(SM_RTLOCK_WAIT); + } + NOKPROBE_SYMBOL(schedule_rtlock); + #endif +@@ -7091,6 +7123,32 @@ static void __setscheduler_prio(struct task_struct *p, int prio) + + #ifdef CONFIG_RT_MUTEXES + ++/* ++ * Would be more useful with typeof()/auto_type but they don't mix with ++ * bit-fields. Since it's a local thing, use int. Keep the generic sounding ++ * name such that if someone were to implement this function we get to compare ++ * notes. ++ */ ++#define fetch_and_set(x, v) ({ int _x = (x); (x) = (v); _x; }) ++ ++void rt_mutex_pre_schedule(void) ++{ ++ lockdep_assert(!fetch_and_set(current->sched_rt_mutex, 1)); ++ sched_submit_work(current); ++} ++ ++void rt_mutex_schedule(void) ++{ ++ lockdep_assert(current->sched_rt_mutex); ++ __schedule_loop(SM_NONE); ++} ++ ++void rt_mutex_post_schedule(void) ++{ ++ sched_update_worker(current); ++ lockdep_assert(fetch_and_set(current->sched_rt_mutex, 0)); ++} ++ + static inline int __rt_effective_prio(struct task_struct *pi_task, int prio) + { + if (pi_task) +@@ -8953,6 +9011,21 @@ static inline void preempt_dynamic_init(void) { } + + #endif /* #ifdef CONFIG_PREEMPT_DYNAMIC */ + ++/* ++ * task_is_pi_boosted - Check if task has been PI boosted. ++ * @p: Task to check. ++ * ++ * Return true if task is subject to priority inheritance. ++ */ ++bool task_is_pi_boosted(const struct task_struct *p) ++{ ++ int prio = p->prio; ++ ++ if (!rt_prio(prio)) ++ return false; ++ return prio != p->normal_prio; ++} ++ + /** + * yield - yield the current processor to other threads. + * +diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c +index 8b3063398..76530c8b3 100644 +--- a/kernel/sched/debug.c ++++ b/kernel/sched/debug.c +@@ -333,6 +333,23 @@ static const struct file_operations sched_debug_fops = { + .release = seq_release, + }; + ++static ssize_t sched_hog_write(struct file *filp, const char __user *ubuf, ++ size_t cnt, loff_t *ppos) ++{ ++ unsigned long end = jiffies + 60 * HZ; ++ ++ for (; time_before(jiffies, end) && !signal_pending(current);) ++ cpu_relax(); ++ ++ return cnt; ++} ++ ++static const struct file_operations sched_hog_fops = { ++ .write = sched_hog_write, ++ .open = simple_open, ++ .llseek = default_llseek, ++}; ++ + static struct dentry *debugfs_sched; + + static __init int sched_init_debug(void) +@@ -374,6 +391,8 @@ static __init int sched_init_debug(void) + + debugfs_create_file("debug", 0444, debugfs_sched, NULL, &sched_debug_fops); + ++ debugfs_create_file("hog", 0200, debugfs_sched, NULL, &sched_hog_fops); ++ + return 0; + } + late_initcall(sched_init_debug); +diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c +index 8de28b182..f71be5bc2 100644 +--- a/kernel/sched/fair.c ++++ b/kernel/sched/fair.c +@@ -1154,8 +1154,10 @@ static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se); + * XXX: strictly: vd_i += N*r_i/w_i such that: vd_i > ve_i + * this is probably good enough. + */ +-static void update_deadline(struct cfs_rq *cfs_rq, struct sched_entity *se) ++static void update_deadline(struct cfs_rq *cfs_rq, struct sched_entity *se, bool tick) + { ++ struct rq *rq = rq_of(cfs_rq); ++ + if ((s64)(se->vruntime - se->deadline) < 0) + return; + +@@ -1174,10 +1176,19 @@ static void update_deadline(struct cfs_rq *cfs_rq, struct sched_entity *se) + /* + * The task has consumed its request, reschedule. + */ +- if (cfs_rq->nr_running > 1) { +- resched_curr(rq_of(cfs_rq)); +- clear_buddies(cfs_rq, se); ++ if (cfs_rq->nr_running < 2) ++ return; ++ ++ if (!IS_ENABLED(CONFIG_PREEMPT_BUILD_AUTO) || sched_feat(FORCE_NEED_RESCHED)) { ++ resched_curr(rq); ++ } else { ++ /* Did the task ignore the lazy reschedule request? */ ++ if (tick && test_tsk_thread_flag(rq->curr, TIF_NEED_RESCHED_LAZY)) ++ resched_curr(rq); ++ else ++ resched_curr_lazy(rq); + } ++ clear_buddies(cfs_rq, se); + } + + #include "pelt.h" +@@ -1285,7 +1296,7 @@ static void update_tg_load_avg(struct cfs_rq *cfs_rq) + /* + * Update the current task's runtime statistics. + */ +-static void update_curr(struct cfs_rq *cfs_rq) ++static void __update_curr(struct cfs_rq *cfs_rq, bool tick) + { + struct sched_entity *curr = cfs_rq->curr; + u64 now = rq_clock_task(rq_of(cfs_rq)); +@@ -1312,7 +1323,7 @@ static void update_curr(struct cfs_rq *cfs_rq) + schedstat_add(cfs_rq->exec_clock, delta_exec); + + curr->vruntime += calc_delta_fair(delta_exec, curr); +- update_deadline(cfs_rq, curr); ++ update_deadline(cfs_rq, curr, tick); + update_min_vruntime(cfs_rq); + + if (entity_is_task(curr)) { +@@ -1326,6 +1337,11 @@ static void update_curr(struct cfs_rq *cfs_rq) + account_cfs_rq_runtime(cfs_rq, delta_exec); + } + ++static inline void update_curr(struct cfs_rq *cfs_rq) ++{ ++ __update_curr(cfs_rq, false); ++} ++ + static void update_curr_fair(struct rq *rq) + { + update_curr(cfs_rq_of(&rq->curr->se)); +@@ -5631,7 +5647,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) + /* + * Update run-time statistics of the 'current'. + */ +- update_curr(cfs_rq); ++ __update_curr(cfs_rq, true); + + /* + * Ensure that runnable average is periodically updated. +@@ -5645,7 +5661,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) + * validating it and just reschedule. + */ + if (queued) { +- resched_curr(rq_of(cfs_rq)); ++ resched_curr_lazy(rq_of(cfs_rq)); + return; + } + /* +@@ -5791,7 +5807,7 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) + * hierarchy can be throttled + */ + if (!assign_cfs_rq_runtime(cfs_rq) && likely(cfs_rq->curr)) +- resched_curr(rq_of(cfs_rq)); ++ resched_curr_lazy(rq_of(cfs_rq)); + } + + static __always_inline +@@ -6090,7 +6106,7 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) + + /* Determine whether we need to wake up potentially idle CPU: */ + if (rq->curr == rq->idle && rq->cfs.nr_running) +- resched_curr(rq); ++ resched_curr_lazy(rq); + } + + #ifdef CONFIG_SMP +@@ -7291,7 +7307,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) + + if (delta < 0) { + if (task_current(rq, p)) +- resched_curr(rq); ++ resched_curr_lazy(rq); + return; + } + hrtick_start(rq, delta); +@@ -9231,7 +9247,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ + * prevents us from potentially nominating it as a false LAST_BUDDY + * below. + */ +- if (test_tsk_need_resched(curr)) ++ if (need_resched()) + return; + + /* Idle tasks are by definition preempted by non-idle tasks. */ +@@ -9273,7 +9289,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ + return; + + preempt: +- resched_curr(rq); ++ resched_curr_lazy(rq); + } + + #ifdef CONFIG_QOS_SCHED +@@ -14139,7 +14155,7 @@ static inline void task_tick_core(struct rq *rq, struct task_struct *curr) + */ + if (rq->core->core_forceidle_count && rq->cfs.nr_running == 1 && + __entity_slice_used(&curr->se, MIN_NR_TASKS_DURING_FORCEIDLE)) +- resched_curr(rq); ++ resched_curr_lazy(rq); + } + + /* +@@ -14455,7 +14471,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) + */ + if (task_current(rq, p)) { + if (p->prio > oldprio) +- resched_curr(rq); ++ resched_curr_lazy(rq); + } else + check_preempt_curr(rq, p, 0); + } +diff --git a/kernel/sched/features.h b/kernel/sched/features.h +index 26b1a03bd..dd519e75b 100644 +--- a/kernel/sched/features.h ++++ b/kernel/sched/features.h +@@ -99,6 +99,7 @@ SCHED_FEAT(LATENCY_WARN, false) + + SCHED_FEAT(HZ_BW, true) + ++SCHED_FEAT(FORCE_NEED_RESCHED, false) + #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY + /* + * Use util_avg of bottom-Level taskgroup +diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c +index 5007b25c5..95e1b3df1 100644 +--- a/kernel/sched/idle.c ++++ b/kernel/sched/idle.c +@@ -57,8 +57,7 @@ static noinline int __cpuidle cpu_idle_poll(void) + ct_cpuidle_enter(); + + raw_local_irq_enable(); +- while (!tif_need_resched() && +- (cpu_idle_force_poll || tick_check_broadcast_expired())) ++ while (!need_resched() && (cpu_idle_force_poll || tick_check_broadcast_expired())) + cpu_relax(); + raw_local_irq_disable(); + +diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c +index 77bb7ee8c..6dedad4f4 100644 +--- a/kernel/sched/rt.c ++++ b/kernel/sched/rt.c +@@ -2256,8 +2256,11 @@ static int rto_next_cpu(struct root_domain *rd) + + rd->rto_cpu = cpu; + +- if (cpu < nr_cpu_ids) ++ if (cpu < nr_cpu_ids) { ++ if (!has_pushable_tasks(cpu_rq(cpu))) ++ continue; + return cpu; ++ } + + rd->rto_cpu = -1; + +diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h +index 9de2bac64..0f60c4654 100644 +--- a/kernel/sched/sched.h ++++ b/kernel/sched/sched.h +@@ -2600,6 +2600,7 @@ extern void init_sched_fair_class(void); + extern void reweight_task(struct task_struct *p, int prio); + + extern void resched_curr(struct rq *rq); ++extern void resched_curr_lazy(struct rq *rq); + extern void resched_cpu(int cpu); + + extern struct rt_bandwidth def_rt_bandwidth; +diff --git a/kernel/signal.c b/kernel/signal.c +index 28cddef39..cf2c75e3e 100644 +--- a/kernel/signal.c ++++ b/kernel/signal.c +@@ -2332,15 +2332,35 @@ static int ptrace_stop(int exit_code, int why, unsigned long message, + do_notify_parent_cldstop(current, false, why); + + /* +- * Don't want to allow preemption here, because +- * sys_ptrace() needs this task to be inactive. ++ * The previous do_notify_parent_cldstop() invocation woke ptracer. ++ * One a PREEMPTION kernel this can result in preemption requirement ++ * which will be fulfilled after read_unlock() and the ptracer will be ++ * put on the CPU. ++ * The ptracer is in wait_task_inactive(, __TASK_TRACED) waiting for ++ * this task wait in schedule(). If this task gets preempted then it ++ * remains enqueued on the runqueue. The ptracer will observe this and ++ * then sleep for a delay of one HZ tick. In the meantime this task ++ * gets scheduled, enters schedule() and will wait for the ptracer. + * +- * XXX: implement read_unlock_no_resched(). ++ * This preemption point is not bad from correctness point of view but ++ * extends the runtime by one HZ tick time due to the ptracer's sleep. ++ * The preempt-disable section ensures that there will be no preemption ++ * between unlock and schedule() and so improving the performance since ++ * the ptracer has no reason to sleep. ++ * ++ * On PREEMPT_RT locking tasklist_lock does not disable preemption. ++ * Therefore the task can be preempted (after ++ * do_notify_parent_cldstop()) before unlocking tasklist_lock so there ++ * is no benefit in doing this. The optimisation is harmful on ++ * PEEMPT_RT because the spinlock_t (in cgroup_enter_frozen()) must not ++ * be acquired with disabled preemption. + */ +- preempt_disable(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_disable(); + read_unlock(&tasklist_lock); + cgroup_enter_frozen(); +- preempt_enable_no_resched(); ++ if (!IS_ENABLED(CONFIG_PREEMPT_RT)) ++ preempt_enable_no_resched(); + schedule(); + cgroup_leave_frozen(true); + +diff --git a/kernel/softirq.c b/kernel/softirq.c +index 210cf5f8d..cae0ae2e2 100644 +--- a/kernel/softirq.c ++++ b/kernel/softirq.c +@@ -247,6 +247,19 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) + } + EXPORT_SYMBOL(__local_bh_enable_ip); + ++void softirq_preempt(void) ++{ ++ if (WARN_ON_ONCE(!preemptible())) ++ return; ++ ++ if (WARN_ON_ONCE(__this_cpu_read(softirq_ctrl.cnt) != SOFTIRQ_OFFSET)) ++ return; ++ ++ __local_bh_enable(SOFTIRQ_OFFSET, true); ++ /* preemption point */ ++ __local_bh_disable_ip(_RET_IP_, SOFTIRQ_OFFSET); ++} ++ + /* + * Invoked from ksoftirqd_run() outside of the interrupt disabled section + * to acquire the per CPU local lock for reentrancy protection. +@@ -619,6 +632,24 @@ static inline void tick_irq_exit(void) + #endif + } + ++#ifdef CONFIG_PREEMPT_RT ++DEFINE_PER_CPU(struct task_struct *, timersd); ++DEFINE_PER_CPU(unsigned long, pending_timer_softirq); ++ ++static void wake_timersd(void) ++{ ++ struct task_struct *tsk = __this_cpu_read(timersd); ++ ++ if (tsk) ++ wake_up_process(tsk); ++} ++ ++#else ++ ++static inline void wake_timersd(void) { } ++ ++#endif ++ + static inline void __irq_exit_rcu(void) + { + #ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED +@@ -631,6 +662,10 @@ static inline void __irq_exit_rcu(void) + if (!in_interrupt() && local_softirq_pending()) + invoke_softirq(); + ++ if (IS_ENABLED(CONFIG_PREEMPT_RT) && local_pending_timers() && ++ !(in_nmi() | in_hardirq())) ++ wake_timersd(); ++ + tick_irq_exit(); + } + +@@ -963,12 +998,70 @@ static struct smp_hotplug_thread softirq_threads = { + .thread_comm = "ksoftirqd/%u", + }; + ++#ifdef CONFIG_PREEMPT_RT ++static void timersd_setup(unsigned int cpu) ++{ ++ sched_set_fifo_low(current); ++} ++ ++static int timersd_should_run(unsigned int cpu) ++{ ++ return local_pending_timers(); ++} ++ ++static void run_timersd(unsigned int cpu) ++{ ++ unsigned int timer_si; ++ ++ ksoftirqd_run_begin(); ++ ++ timer_si = local_pending_timers(); ++ __this_cpu_write(pending_timer_softirq, 0); ++ or_softirq_pending(timer_si); ++ ++ __do_softirq(); ++ ++ ksoftirqd_run_end(); ++} ++ ++static void raise_ktimers_thread(unsigned int nr) ++{ ++ trace_softirq_raise(nr); ++ __this_cpu_or(pending_timer_softirq, 1 << nr); ++} ++ ++void raise_hrtimer_softirq(void) ++{ ++ raise_ktimers_thread(HRTIMER_SOFTIRQ); ++} ++ ++void raise_timer_softirq(void) ++{ ++ unsigned long flags; ++ ++ local_irq_save(flags); ++ raise_ktimers_thread(TIMER_SOFTIRQ); ++ wake_timersd(); ++ local_irq_restore(flags); ++} ++ ++static struct smp_hotplug_thread timer_threads = { ++ .store = &timersd, ++ .setup = timersd_setup, ++ .thread_should_run = timersd_should_run, ++ .thread_fn = run_timersd, ++ .thread_comm = "ktimers/%u", ++}; ++#endif ++ + static __init int spawn_ksoftirqd(void) + { + cpuhp_setup_state_nocalls(CPUHP_SOFTIRQ_DEAD, "softirq:dead", NULL, + takeover_tasklets); + BUG_ON(smpboot_register_percpu_thread(&softirq_threads)); +- ++#ifdef CONFIG_PREEMPT_RT ++ BUG_ON(smpboot_register_percpu_thread(&timer_threads)); ++#endif + return 0; + } + early_initcall(spawn_ksoftirqd); +diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c +index edb0f821d..a72900121 100644 +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -1809,7 +1809,7 @@ void hrtimer_interrupt(struct clock_event_device *dev) + if (!ktime_before(now, cpu_base->softirq_expires_next)) { + cpu_base->softirq_expires_next = KTIME_MAX; + cpu_base->softirq_activated = 1; +- raise_softirq_irqoff(HRTIMER_SOFTIRQ); ++ raise_hrtimer_softirq(); + } + + __hrtimer_run_queues(cpu_base, now, flags, HRTIMER_ACTIVE_HARD); +@@ -1922,7 +1922,7 @@ void hrtimer_run_queues(void) + if (!ktime_before(now, cpu_base->softirq_expires_next)) { + cpu_base->softirq_expires_next = KTIME_MAX; + cpu_base->softirq_activated = 1; +- raise_softirq_irqoff(HRTIMER_SOFTIRQ); ++ raise_hrtimer_softirq(); + } + + __hrtimer_run_queues(cpu_base, now, flags, HRTIMER_ACTIVE_HARD); +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c +index 55cbc49f7..1a0ed106b 100644 +--- a/kernel/time/tick-sched.c ++++ b/kernel/time/tick-sched.c +@@ -795,7 +795,7 @@ static void tick_nohz_restart(struct tick_sched *ts, ktime_t now) + + static inline bool local_timer_softirq_pending(void) + { +- return local_softirq_pending() & BIT(TIMER_SOFTIRQ); ++ return local_pending_timers() & BIT(TIMER_SOFTIRQ); + } + + static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu) +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 63a8ce717..b3fbe97d1 100644 +--- a/kernel/time/timer.c ++++ b/kernel/time/timer.c +@@ -1470,9 +1470,16 @@ static inline void timer_base_unlock_expiry(struct timer_base *base) + */ + static void timer_sync_wait_running(struct timer_base *base) + { +- if (atomic_read(&base->timer_waiters)) { ++ bool need_preempt; ++ ++ need_preempt = task_is_pi_boosted(current); ++ if (need_preempt || atomic_read(&base->timer_waiters)) { + raw_spin_unlock_irq(&base->lock); + spin_unlock(&base->expiry_lock); ++ ++ if (need_preempt) ++ softirq_preempt(); ++ + spin_lock(&base->expiry_lock); + raw_spin_lock_irq(&base->lock); + } +@@ -2054,7 +2061,7 @@ static void run_local_timers(void) + if (time_before(jiffies, base->next_expiry)) + return; + } +- raise_softirq(TIMER_SOFTIRQ); ++ raise_timer_softirq(); + } + + /* +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index c0831e669..5436270e0 100644 +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -2708,6 +2708,8 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status) + + if (tif_need_resched()) + trace_flags |= TRACE_FLAG_NEED_RESCHED; ++ if (tif_need_resched_lazy()) ++ trace_flags |= TRACE_FLAG_NEED_RESCHED_LAZY; + if (test_preempt_need_resched()) + trace_flags |= TRACE_FLAG_PREEMPT_RESCHED; + return (trace_flags << 16) | (min_t(unsigned int, pc & 0xff, 0xf)) | +diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c +index 3b7d3e9eb..5a4fefbc0 100644 +--- a/kernel/trace/trace_output.c ++++ b/kernel/trace/trace_output.c +@@ -460,17 +460,29 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) + (entry->flags & TRACE_FLAG_IRQS_OFF && bh_off) ? 'D' : + (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : + bh_off ? 'b' : +- (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ? 'X' : ++ !IS_ENABLED(CONFIG_TRACE_IRQFLAGS_SUPPORT) ? 'X' : + '.'; + +- switch (entry->flags & (TRACE_FLAG_NEED_RESCHED | ++ switch (entry->flags & (TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY | + TRACE_FLAG_PREEMPT_RESCHED)) { ++ case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY | TRACE_FLAG_PREEMPT_RESCHED: ++ need_resched = 'B'; ++ break; + case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_PREEMPT_RESCHED: + need_resched = 'N'; + break; ++ case TRACE_FLAG_NEED_RESCHED_LAZY | TRACE_FLAG_PREEMPT_RESCHED: ++ need_resched = 'L'; ++ break; ++ case TRACE_FLAG_NEED_RESCHED | TRACE_FLAG_NEED_RESCHED_LAZY: ++ need_resched = 'b'; ++ break; + case TRACE_FLAG_NEED_RESCHED: + need_resched = 'n'; + break; ++ case TRACE_FLAG_NEED_RESCHED_LAZY: ++ need_resched = 'l'; ++ break; + case TRACE_FLAG_PREEMPT_RESCHED: + need_resched = 'p'; + break; +diff --git a/net/core/dev.c b/net/core/dev.c +index 1f6c8945f..1e8928cd3 100644 +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -4705,15 +4705,6 @@ static void rps_trigger_softirq(void *data) + + #endif /* CONFIG_RPS */ + +-/* Called from hardirq (IPI) context */ +-static void trigger_rx_softirq(void *data) +-{ +- struct softnet_data *sd = data; +- +- __raise_softirq_irqoff(NET_RX_SOFTIRQ); +- smp_store_release(&sd->defer_ipi_scheduled, 0); +-} +- + /* + * After we queued a packet into sd->input_pkt_queue, + * we need to make sure this queue is serviced soon. +@@ -6682,6 +6673,32 @@ static void skb_defer_free_flush(struct softnet_data *sd) + } + } + ++#ifndef CONFIG_PREEMPT_RT ++ ++/* Called from hardirq (IPI) context */ ++static void trigger_rx_softirq(void *data) ++{ ++ struct softnet_data *sd = data; ++ ++ __raise_softirq_irqoff(NET_RX_SOFTIRQ); ++ smp_store_release(&sd->defer_ipi_scheduled, 0); ++} ++ ++#else ++ ++static void trigger_rx_softirq(struct work_struct *defer_work) ++{ ++ struct softnet_data *sd; ++ ++ sd = container_of(defer_work, struct softnet_data, defer_work); ++ smp_store_release(&sd->defer_ipi_scheduled, 0); ++ local_bh_disable(); ++ skb_defer_free_flush(sd); ++ local_bh_enable(); ++} ++ ++#endif ++ + static int napi_threaded_poll(void *data) + { + struct napi_struct *napi = data; +@@ -11618,7 +11635,11 @@ static int __init net_dev_init(void) + INIT_CSD(&sd->csd, rps_trigger_softirq, sd); + sd->cpu = i; + #endif ++#ifndef CONFIG_PREEMPT_RT + INIT_CSD(&sd->defer_csd, trigger_rx_softirq, sd); ++#else ++ INIT_WORK(&sd->defer_work, trigger_rx_softirq); ++#endif + spin_lock_init(&sd->defer_lock); + + init_gro_hash(&sd->backlog); +diff --git a/net/core/skbuff.c b/net/core/skbuff.c +index 60876262b..02e2bab1e 100644 +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -6852,8 +6852,13 @@ nodefer: __kfree_skb(skb); + /* Make sure to trigger NET_RX_SOFTIRQ on the remote CPU + * if we are unlucky enough (this seems very unlikely). + */ +- if (unlikely(kick) && !cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) ++ if (unlikely(kick) && !cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) { ++#ifndef CONFIG_PREEMPT_RT + smp_call_function_single_async(cpu, &sd->defer_csd); ++#else ++ schedule_work_on(cpu, &sd->defer_work); ++#endif ++ } + } + + static void skb_splice_csum_page(struct sk_buff *skb, struct page *page, +-- +2.41.0 + diff --git a/patch-6.6.0-6.0.0-rt20.patch-openeuler_defconfig.patch b/patch-6.6.0-6.0.0-rt20.patch-openeuler_defconfig.patch new file mode 100644 index 0000000..271c6d3 --- /dev/null +++ b/patch-6.6.0-6.0.0-rt20.patch-openeuler_defconfig.patch @@ -0,0 +1,71 @@ +From e93a1a59a66d13f8de1e57c029970c316f421cd7 Mon Sep 17 00:00:00 2001 +From: zhangyu +Date: Fri, 10 May 2024 12:20:10 +0800 +Subject: [PATCH 2/2] rt1 + +--- + arch/arm64/configs/openeuler_defconfig | 4 ++-- + arch/x86/configs/openeuler_defconfig | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/arch/arm64/configs/openeuler_defconfig b/arch/arm64/configs/openeuler_defconfig +index baf9159c9..8d4709cc0 100644 +--- a/arch/arm64/configs/openeuler_defconfig ++++ b/arch/arm64/configs/openeuler_defconfig +@@ -97,7 +97,7 @@ CONFIG_PREEMPT_NONE=y + # CONFIG_PREEMPT is not set + # CONFIG_PREEMPT_DYNAMIC is not set + # CONFIG_SCHED_CORE is not set +- ++CONFIG_PREEMPT_RT=y + # + # CPU/Task time and stats accounting + # +@@ -749,7 +749,7 @@ CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE=y + CONFIG_KVM_HISI_VIRT=y + CONFIG_KVM_XFER_TO_GUEST_WORK=y + CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y +-CONFIG_VIRTUALIZATION=y ++#CONFIG_VIRTUALIZATION is not set + CONFIG_KVM=y + CONFIG_KVM_ARM_MULTI_LPI_TRANSLATE_CACHE=y + # CONFIG_NVHE_EL2_DEBUG is not set +diff --git a/arch/x86/configs/openeuler_defconfig b/arch/x86/configs/openeuler_defconfig +index e68707028..c20a4c0c4 100644 +--- a/arch/x86/configs/openeuler_defconfig ++++ b/arch/x86/configs/openeuler_defconfig +@@ -110,11 +110,11 @@ CONFIG_BPF_SCHED=y + # end of BPF subsystem + + CONFIG_PREEMPT_NONE_BUILD=y +-CONFIG_PREEMPT_NONE=y ++#CONFIG_PREEMPT_NONE is not set + # CONFIG_PREEMPT_VOLUNTARY is not set + # CONFIG_PREEMPT is not set + # CONFIG_PREEMPT_DYNAMIC is not set +- ++CONFIG_PREEMPT_RT=y + # + # CPU/Task time and stats accounting + # +@@ -245,7 +245,7 @@ CONFIG_SYSCTL=y + CONFIG_HAVE_UID16=y + CONFIG_SYSCTL_EXCEPTION_TRACE=y + CONFIG_HAVE_PCSPKR_PLATFORM=y +-# CONFIG_EXPERT is not set ++CONFIG_EXPERT=y + CONFIG_UID16=y + CONFIG_MULTIUSER=y + CONFIG_SGETMASK_SYSCALL=y +@@ -740,7 +740,7 @@ CONFIG_HAVE_KVM_NO_POLL=y + CONFIG_KVM_XFER_TO_GUEST_WORK=y + CONFIG_HAVE_KVM_PM_NOTIFIER=y + CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y +-CONFIG_VIRTUALIZATION=y ++# CONFIG_VIRTUALIZATION is not set + CONFIG_KVM=m + CONFIG_KVM_INTEL=m + CONFIG_X86_SGX_KVM=y +-- +2.41.0 +