diff --git a/meta-lmp-base/conf/distro/include/non-clangable.inc b/meta-lmp-base/conf/distro/include/non-clangable.inc index b55a7b8c11..45b4a5510c 100644 --- a/meta-lmp-base/conf/distro/include/non-clangable.inc +++ b/meta-lmp-base/conf/distro/include/non-clangable.inc @@ -110,8 +110,6 @@ OBJCOPY:pn-linux-lmp-fslc-imx:toolchain-clang = "${HOST_PREFIX}objcopy" STRIP:pn-linux-lmp-fslc-imx:toolchain-clang = "${HOST_PREFIX}strip" OBJCOPY:pn-linux-lmp-fslc-imx-rt:toolchain-clang = "${HOST_PREFIX}objcopy" STRIP:pn-linux-lmp-fslc-imx-rt:toolchain-clang = "${HOST_PREFIX}strip" -OBJCOPY:pn-linux-lmp-fslc-imx-xeno4:toolchain-clang = "${HOST_PREFIX}objcopy" -STRIP:pn-linux-lmp-fslc-imx-xeno4:toolchain-clang = "${HOST_PREFIX}strip" OBJCOPY:pn-linux-lmp-ti-staging:toolchain-clang = "${HOST_PREFIX}objcopy" STRIP:pn-linux-lmp-ti-staging:toolchain-clang = "${HOST_PREFIX}strip" OBJCOPY:pn-linux-tegra:toolchain-clang = "${HOST_PREFIX}objcopy" @@ -123,7 +121,6 @@ STRIP:pn-linux-tegra-rt:toolchain-clang = "${HOST_PREFIX}strip" # error: passing 'unsigned int *' to parameter of type 'int *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign] # error: fields must have a constant size: 'variable length array in structure' extension will never be supported # error: passing 'typeof (((fundle_t)0)) *' (aka 'unsigned int *') to parameter of type '__s32 *' (aka 'int *') converts between pointers to integer types with different sign [-Werror,-Wpointer-sign] -TOOLCHAIN:pn-xenomai4 = "gcc" # qemuarm64-secureboot # | ld.lld: error: cannot open /usr/lib/clang/14.0.3/lib/linux/libclang_rt.builtins-aarch64.a: No such file or directory diff --git a/meta-lmp-base/recipes-kernel/linux/kmeta-linux-lmp-6.6.y.inc b/meta-lmp-base/recipes-kernel/linux/kmeta-linux-lmp-6.6.y.inc index b0dffc9fe5..f33dcc46f6 100644 --- a/meta-lmp-base/recipes-kernel/linux/kmeta-linux-lmp-6.6.y.inc +++ b/meta-lmp-base/recipes-kernel/linux/kmeta-linux-lmp-6.6.y.inc @@ -1,4 +1,4 @@ KERNEL_META_REPO ?= "git://github.com/foundriesio/lmp-kernel-cache.git" KERNEL_META_REPO_PROTOCOL ?= "https" KERNEL_META_BRANCH ?= "linux-v6.6.y" -KERNEL_META_COMMIT ?= "16feae8a4ea6595371ff285c89648c196fe35ccf" +KERNEL_META_COMMIT ?= "b968a4e3dfade014a8732c733de6e344bf040bfd" diff --git a/meta-lmp-base/recipes-kernel/linux/linux-lmp-dev-mfgtool_git.bb b/meta-lmp-base/recipes-kernel/linux/linux-lmp-dev-mfgtool_git.bb index 8d34859a08..4656c4c9bf 100644 --- a/meta-lmp-base/recipes-kernel/linux/linux-lmp-dev-mfgtool_git.bb +++ b/meta-lmp-base/recipes-kernel/linux/linux-lmp-dev-mfgtool_git.bb @@ -5,9 +5,9 @@ compatible Linux Kernel to be used in updater environment" # Use Freescale kernel by default KERNEL_REPO ?= "git://github.com/Freescale/linux-fslc.git" KERNEL_REPO_PROTOCOL ?= "https" -LINUX_VERSION ?= "6.1.70" -KERNEL_BRANCH ?= "6.1-2.2.x-imx" -KERNEL_COMMIT ?= "4e3fc5471376a15279ee5c99e791a7c7b065cbc1" +LINUX_VERSION ?= "6.6.54" +KERNEL_BRANCH ?= "6.6-2.1.x-imx" +KERNEL_COMMIT ?= "6605f549a71ef3af9c65609cba985086ac4edf2b" # Drop features that are appended by other layers (not required here) KERNEL_FEATURES:remove = "cfg/fs/vfat.scc" diff --git a/meta-lmp-base/recipes-kernel/xenomai4/xenomai4_git.bb b/meta-lmp-base/recipes-kernel/xenomai4/xenomai4_git.bb deleted file mode 100644 index 9a482756a3..0000000000 --- a/meta-lmp-base/recipes-kernel/xenomai4/xenomai4_git.bb +++ /dev/null @@ -1,35 +0,0 @@ -SUMMARY = "Xenomai 4" -DESCRIPTION = "Xenomai 4 user support (libevl)" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=2500c28da9dacbee31a3f4d4f69b74d0" - -SRCBRANCH = "master" - -SRC_URI = "git://source.denx.de/Xenomai/xenomai4/libevl.git;protocol=https;branch=${SRCBRANCH}" -SRCREV = "49beb39a88fbb7bca43ab27ac9e53abbb1695262" - -S = "${WORKDIR}/git" - -# We need the kernel sources to be available, so build it first. -DEPENDS += "virtual/kernel" - -# We may need this for 64bit atomic ops. -RDEPENDS:${PN}:append:libc-glibc = " libgcc" - -inherit pkgconfig meson features_check - -REQUIRED_MACHINE_FEATURES = "xeno4" - -PACKAGECONFIG ?= "" -PACKAGECONFIG[debug] = "-Doptimization=0 -Ddebug=true,,," - -EXTRA_OEMESON = "-Duapi=${STAGING_KERNEL_DIR}" - -PACKAGES += "${PN}-test" - -FILES:${PN}-test = "${prefix}/tests" - -# install the test by default and use BAD_RECOMMENDATIONS when not desired -RRECOMMENDS:${PN} += "${PN}-test" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta-lmp-base/recipes-samples/images/lmp-base-console-image.bb b/meta-lmp-base/recipes-samples/images/lmp-base-console-image.bb index 372b99ada5..2fad5ad61d 100644 --- a/meta-lmp-base/recipes-samples/images/lmp-base-console-image.bb +++ b/meta-lmp-base/recipes-samples/images/lmp-base-console-image.bb @@ -12,7 +12,6 @@ require lmp-feature-ota-utils.inc require lmp-feature-softhsm.inc require lmp-feature-jobserv.inc -require ${@bb.utils.contains('MACHINE_FEATURES', 'xeno4', 'lmp-feature-xeno4.inc', '', d)} require ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'lmp-feature-optee.inc', '', d)} require ${@bb.utils.contains('MACHINE_FEATURES', 'se05x', 'lmp-feature-se05x.inc', '', d)} require ${@bb.utils.contains('MACHINE_FEATURES', 'tpm2', 'lmp-feature-tpm2.inc', '', d)} diff --git a/meta-lmp-base/recipes-samples/images/lmp-feature-xeno4.inc b/meta-lmp-base/recipes-samples/images/lmp-feature-xeno4.inc deleted file mode 100644 index 8a8ff57500..0000000000 --- a/meta-lmp-base/recipes-samples/images/lmp-feature-xeno4.inc +++ /dev/null @@ -1,4 +0,0 @@ -# Xenomai4 packages -CORE_IMAGE_BASE_INSTALL += " \ - xenomai4 \ -" diff --git a/meta-lmp-base/recipes-sota/ostreeuploader/ostreeuploader_git.bb b/meta-lmp-base/recipes-sota/ostreeuploader/ostreeuploader_git.bb index 07d0fb0685..f5774e8753 100644 --- a/meta-lmp-base/recipes-sota/ostreeuploader/ostreeuploader_git.bb +++ b/meta-lmp-base/recipes-sota/ostreeuploader/ostreeuploader_git.bb @@ -2,7 +2,7 @@ DESCRIPTION = "Tools used to push an ostree repo to and check if it is synced wi HOMEPAGE = "https://github.com/foundriesio/ostreeuploader" SECTION = "devel" LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=2a944942e1496af1886903d274dedb13" +LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=6da28bf14f8fa478195ced00edf4ab7b" GO_IMPORT = "github.com/foundriesio/ostreeuploader" GO_IMPORT_PROTO ?= "https" diff --git a/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc b/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc index 89e95f35da..1e422eb270 100644 --- a/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc +++ b/meta-lmp-bsp/conf/machine/include/lmp-machine-custom.inc @@ -7,7 +7,7 @@ WKS_FILE_DEPENDS:append:beaglebone-yocto = " u-boot-default-script" PREFERRED_PROVIDER_u-boot-default-script:beaglebone-yocto = "u-boot-ostree-scr-fit" SOTA_CLIENT_FEATURES:append:beaglebone-yocto = " ubootenv" OSTREE_KERNEL_ARGS:beaglebone-yocto ?= "console=ttyS0,115200n8 ${OSTREE_KERNEL_ARGS_COMMON}" -KERNEL_DEVICETREE:append:beaglebone-yocto = " am335x-boneblack-wireless.dtb" +KERNEL_DEVICETREE:beaglebone-yocto = "${DTB_FILES} am335x-boneblack-wireless.dtb" IMAGE_BOOT_FILES:beaglebone-yocto = "u-boot.img MLO boot.itb" KERNEL_IMAGETYPE:beaglebone-yocto = "fitImage" KERNEL_CLASSES:beaglebone-yocto = " kernel-lmp-fitimage " @@ -192,7 +192,6 @@ PREFERRED_VERSION_u-boot-fio:mx6ul-nxp-bsp ?= "imx-2023.04" # iMX6UL EVK UBOOT_SIGN_ENABLE:sota:imx6ulevk ?= "1" SOTA_CLIENT_FEATURES:append:imx6ulevk = " ubootenv" -KERNEL_DEVICETREE:imx6ulevk = "imx6ul-14x14-evk.dtb" BOOTSCR_LOAD_ADDR:imx6ulevk = "0x85000000" # iMX6ULL @@ -220,7 +219,6 @@ PREFERRED_VERSION_u-boot-fio:mx6ull-nxp-bsp ?= "imx-2023.04" # iMX6ULL EVK UBOOT_SIGN_ENABLE:sota:imx6ullevk ?= "1" SOTA_CLIENT_FEATURES:append:imx6ullevk = " ubootenv" -KERNEL_DEVICETREE:imx6ullevk = "imx6ull-14x14-evk.dtb" BOOTSCR_LOAD_ADDR:imx6ullevk = "0x85000000" # iMX8QM @@ -363,7 +361,6 @@ MACHINE_FIRMWARE:append:imx8mm-lpddr4-evk = " linux-firmware-qca" KERNEL_DEVICETREE:append:imx8mm-lpddr4-evk = " freescale/imx8mm-evkb.dtb" KMACHINE:imx8mm-lpddr4-evk = "imx8mmevk" OSTREE_KERNEL_ARGS:imx8mm-lpddr4-evk ?= "console=tty1 console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200 rootfstype=ext4" -PREFERRED_PROVIDER_virtual/dtb:imx8mm-lpddr4-evk ?= "lmp-device-tree" SOTA_CLIENT_FEATURES:append:imx8mm-lpddr4-evk = " ubootenv" BOOTSCR_LOAD_ADDR:imx8mm-lpddr4-evk = "0x44800000" ## iMX8MM EVK with secure boot support @@ -705,15 +702,14 @@ DEPLOY_DIR_SPDX:append = "${@'/${MACHINE}' if 'ti-soc' in (d.getVar('SOC_FAMILY' LICENSE_DIRECTORY:append = "${@'/${MACHINE}' if 'ti-soc' in (d.getVar('SOC_FAMILY') or '').split(':') else ''}" UBOOT_SIGN_ENABLE:sota:k3 = "1" UBOOT_SIGN_KEYDIR:k3 ?= "${TOPDIR}/conf/keys" -FIT_HASH_ALG:sota:k3 ?= "sha256" -FIT_SIGN_ALG:sota:k3 ?= "rsa2048" +FIT_HASH_ALG:k3 ?= "sha256" +FIT_SIGN_ALG:k3 ?= "rsa2048" KERNEL_IMAGETYPE:sota:k3 = "fitImage" KERNEL_IMAGETYPES:sota:k3 = "${KERNEL_IMAGETYPE}" PREFERRED_PROVIDER_virtual/kernel:k3 ?= "linux-lmp-ti-staging" WKS_FILE_DEPENDS:append:k3 = " virtual/bootloader" OSTREE_DEPLOY_USR_OSTREE_BOOT:k3 = "${@bb.utils.contains('DISTRO_FEATURES', 'luks', '1', '0', d)}" MACHINE_ESSENTIAL_EXTRA_RDEPENDS:remove:k3 = "kernel-image-image" -KERNEL_DEVICETREE:beaglebone-yocto = "${DTB_FILES}" # TI AM62x MACHINE_FEATURES:append:am62xx = " optee" diff --git a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-kernel/linux/linux-lmp-ti-staging_6.6.bb b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-kernel/linux/linux-lmp-ti-staging_6.6.bb index 8c096b1a03..f3fe43f48e 100644 --- a/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-kernel/linux/linux-lmp-ti-staging_6.6.bb +++ b/meta-lmp-bsp/dynamic-layers/meta-ti-bsp/recipes-kernel/linux/linux-lmp-ti-staging_6.6.bb @@ -20,6 +20,8 @@ KMETA = "kernel-meta" include recipes-kernel/linux/linux-lmp.inc +include ${@ 'recipes-kernel/linux/ti-kernel-devicetree-prefix.inc' if d.getVar('KERNEL_DEVICETREE_PREFIX') else ''} + # Special configuration for remoteproc/rpmsg IPC modules module_conf_rpmsg_client_sample = "blacklist rpmsg_client_sample" module_conf_ti_k3_r5_remoteproc = "softdep ti_k3_r5_remoteproc pre: virtio_rpmsg_bus" diff --git a/meta-lmp-bsp/recipes-bsp/device-tree/lmp-device-tree.bbappend b/meta-lmp-bsp/recipes-bsp/device-tree/lmp-device-tree.bbappend index 20996c4b50..606d169fd6 100644 --- a/meta-lmp-bsp/recipes-bsp/device-tree/lmp-device-tree.bbappend +++ b/meta-lmp-bsp/recipes-bsp/device-tree/lmp-device-tree.bbappend @@ -7,9 +7,3 @@ SRC_URI:append:rpi = " \ file://overlays_spi0.dts \ " COMPATIBLE_MACHINE:rpi = ".*" - -# Name compatible with 4.19-based BSP -SRC_URI:append:imx8mm-lpddr4-evk = " \ - file://freescale_fsl-imx8mm-evk.dts \ -" -COMPATIBLE_MACHINE:imx8mm-lpddr4-evk = ".*" diff --git a/meta-lmp-bsp/recipes-bsp/device-tree/lmp-device-tree/freescale_fsl-imx8mm-evk.dts b/meta-lmp-bsp/recipes-bsp/device-tree/lmp-device-tree/freescale_fsl-imx8mm-evk.dts deleted file mode 100644 index be6c823a61..0000000000 --- a/meta-lmp-bsp/recipes-bsp/device-tree/lmp-device-tree/freescale_fsl-imx8mm-evk.dts +++ /dev/null @@ -1 +0,0 @@ -#include "imx8mm-evk.dts" diff --git a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/imx6ulevk/boot.cmd b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/imx6ulevk/boot.cmd index 4b934022a3..9c129f79a9 100644 --- a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/imx6ulevk/boot.cmd +++ b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/imx6ulevk/boot.cmd @@ -2,7 +2,7 @@ run findfdt echo "Using ${fdt_file}" -setenv fdt_file_final ${fdt_file} +setenv fdt_file_final nxp_imx_${fdt_file} # Default boot type and device setenv bootlimit 3 diff --git a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/imx6ullevk/boot.cmd b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/imx6ullevk/boot.cmd index 4b934022a3..9c129f79a9 100644 --- a/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/imx6ullevk/boot.cmd +++ b/meta-lmp-bsp/recipes-bsp/u-boot/u-boot-ostree-scr-fit/imx6ullevk/boot.cmd @@ -2,7 +2,7 @@ run findfdt echo "Using ${fdt_file}" -setenv fdt_file_final ${fdt_file} +setenv fdt_file_final nxp_imx_${fdt_file} # Default boot type and device setenv bootlimit 3 diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-rt_6.1.bb b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-rt_6.6.bb similarity index 100% rename from meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-rt_6.1.bb rename to meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-rt_6.6.bb diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0001-FIO-extras-arm64-dts-imx8mm-evk-use-imx8mm-evkb-for-.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0001-FIO-extras-arm64-dts-imx8mm-evk-use-imx8mm-evkb-for-.patch deleted file mode 100644 index adae794938..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0001-FIO-extras-arm64-dts-imx8mm-evk-use-imx8mm-evkb-for-.patch +++ /dev/null @@ -1,612 +0,0 @@ -From a47f2cef1ce51c81e238622d5a3c6b20353f56d0 Mon Sep 17 00:00:00 2001 -From: Ricardo Salveti -Date: Fri, 14 May 2021 13:36:10 -0300 -Subject: [PATCH] [FIO extras] arm64: dts: imx8mm-evk: use imx8mm-evkb for the - new EVKs - -Allow older EVKs to be transitioned properly by using a new dtb for the -EVKB variant. - -Main difference is the pmic used (bd71847 -> pca9450). - -Upstream-Status: Inappropriate [configuration] - -Signed-off-by: Ricardo Salveti -Signed-off-by: Oleksandr Suvorov ---- - .../dts/freescale/imx8mm-evk-8mic-revE.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-ak4497.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-ak5558.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-dpdk.dts | 2 +- - .../dts/freescale/imx8mm-evk-ecspi-slave.dts | 2 +- - .../imx8mm-evk-hifiberry-dacplus.dts | 2 +- - .../freescale/imx8mm-evk-iqaudio-dacplus.dts | 2 +- - .../freescale/imx8mm-evk-iqaudio-dacpro.dts | 69 ++++++++- - .../boot/dts/freescale/imx8mm-evk-lk.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-pcie-ep.dts | 2 +- - .../dts/freescale/imx8mm-evk-qca-wifi.dts | 3 +- - .../boot/dts/freescale/imx8mm-evk-rm67191.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-root.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-rpmsg.dts | 2 +- - .../dts/freescale/imx8mm-evk-usd-wifi.dts | 2 +- - arch/arm64/boot/dts/freescale/imx8mm-evk.dts | 139 +---------------- - arch/arm64/boot/dts/freescale/imx8mm-evkb.dts | 142 ++++++++++++++++++ - 17 files changed, 227 insertions(+), 152 deletions(-) - mode change 100755 => 100644 arch/arm64/boot/dts/freescale/imx8mm-evk-qca-wifi.dts - mode change 100755 => 100644 arch/arm64/boot/dts/freescale/imx8mm-evk.dts - create mode 100644 arch/arm64/boot/dts/freescale/imx8mm-evkb.dts - -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-8mic-revE.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-8mic-revE.dts -index 5facaecc733f..36d70369af08 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-8mic-revE.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-8mic-revE.dts -@@ -3,7 +3,7 @@ - * Copyright 2020 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - mic_leds { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts -index ca8e5d7b35d8..4cf5b10b55a6 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts -@@ -3,7 +3,7 @@ - * Copyright 2019 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - sound-ak4458 { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-ak5558.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-ak5558.dts -index 4d3da8e33688..149b5cf67ce7 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-ak5558.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-ak5558.dts -@@ -4,7 +4,7 @@ - */ - - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - sound-ak5558 { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-dpdk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-dpdk.dts -index e600a7208c1f..08a4c3232ccf 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-dpdk.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-dpdk.dts -@@ -3,7 +3,7 @@ - * Copyright 2021 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - ðphy0 { - /delete-property/ reset-assert-us; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-ecspi-slave.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-ecspi-slave.dts -index e06dbc00d9dc..b0670f2cde37 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-ecspi-slave.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-ecspi-slave.dts -@@ -2,7 +2,7 @@ - // - // Copyright 2020 NXP - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - /delete-node/&spidev0; - -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-hifiberry-dacplus.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-hifiberry-dacplus.dts -index 9115dd67eb70..47273b11ec6c 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-hifiberry-dacplus.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-hifiberry-dacplus.dts -@@ -3,7 +3,7 @@ - * Copyright 2020 NXP. - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - ext_osc_22m: ext-osc-22m { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacplus.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacplus.dts -index 3a1ccd204a5a..e5df1348c8e3 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacplus.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacplus.dts -@@ -3,7 +3,7 @@ - * Copyright 2020 NXP. - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - reg_3v3_vext: regulator-3v3-vext { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacpro.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacpro.dts -index ce99f4338cd2..85b3ec59fef3 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacpro.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacpro.dts -@@ -3,10 +3,77 @@ - * Copyright 2020 NXP. - */ - --#include "imx8mm-evk-iqaudio-dacplus.dts" -+#include "imx8mm-evkb.dts" -+ -+/ { -+ reg_3v3_vext: regulator-3v3-vext { -+ compatible = "regulator-fixed"; -+ regulator-name = "3V3_VEXT"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ }; -+ -+ sound-ak4458 { -+ status = "disabled"; -+ }; -+ -+ sound-micfil { -+ status = "disabled"; -+ }; -+ -+ sound-pcm512x { -+ compatible = "fsl,imx-audio-pcm512x"; -+ model = "pcm512x-audio"; -+ audio-cpu = <&sai5>; -+ audio-codec = <&pcm512x>; -+ format = "i2s"; -+ audio-widgets = -+ "Line", "Left Line Out Jack", -+ "Line", "Right Line Out Jack"; -+ audio-routing = -+ "Left Line Out Jack", "OUTL", -+ "Right Line Out Jack", "OUTR"; -+ dac,24db_digital_gain; -+ }; -+}; - - &i2c3 { -+ ak4458_1: ak4458@10 { -+ status = "disabled"; -+ }; -+ -+ ak4458_2: ak4458@12 { -+ status = "disabled"; -+ }; -+ -+ ak4497: ak4497@11 { -+ status = "disabled"; -+ }; -+ - pcm512x: pcm512x@4c { - compatible = "ti,pcm5142"; -+ reg = <0x4c>; -+ AVDD-supply = <®_3v3_vext>; -+ DVDD-supply = <®_3v3_vext>; -+ CPVDD-supply = <®_3v3_vext>; - }; - }; -+ -+&iomuxc { -+ pinctrl_sai5: sai5grp { -+ fsl,pins = < -+ MX8MM_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0xd6 -+ MX8MM_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0xd6 -+ MX8MM_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0xd6 -+ MX8MM_IOMUXC_SAI5_RXD0_SAI5_RX_DATA0 0xd6 -+ >; -+ }; -+}; -+ -+&micfil { -+ status = "disabled"; -+}; -+ -+&sai5 { -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-lk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-lk.dts -index ccf3e9901e32..16e32e7f1aed 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-lk.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-lk.dts -@@ -3,7 +3,7 @@ - * Copyright 2019-2021 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - interrupt-parent = <&gic>; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-pcie-ep.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-pcie-ep.dts -index 2f96420e3230..61202cae7f3b 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-pcie-ep.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-pcie-ep.dts -@@ -5,7 +5,7 @@ - - /dts-v1/; - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - &pcie0{ - status = "disabled"; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-qca-wifi.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-qca-wifi.dts -old mode 100755 -new mode 100644 -index aa1a25f00f55..b5cbd103880d ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-qca-wifi.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-qca-wifi.dts -@@ -5,10 +5,11 @@ - - /dts-v1/; - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - model = "FSL i.MX8MM LPDDR4 EVK with QCA WIFI revC board "; -+ compatible = "fsl,imx8mm-evk", "fsl,imx8mm"; - }; - - /delete-node/&pmic_nxp; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-rm67191.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-rm67191.dts -index 958912c409b2..d6563b7a41da 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-rm67191.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-rm67191.dts -@@ -3,7 +3,7 @@ - * Copyright 2019,2021 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - &adv_bridge { - status = "disabled"; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-root.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-root.dts -index 426b0adc31ce..3986daaec096 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-root.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-root.dts -@@ -3,7 +3,7 @@ - * Copyright 2019 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - interrupt-parent = <&gic>; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-rpmsg.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-rpmsg.dts -index 2a477c74b634..46e817739e9f 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-rpmsg.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-rpmsg.dts -@@ -5,7 +5,7 @@ - - /dts-v1/; - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - reserved-memory { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-usd-wifi.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-usd-wifi.dts -index 9bf4ce755d5c..c9c792ca4c3d 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-usd-wifi.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-usd-wifi.dts -@@ -5,7 +5,7 @@ - - /dts-v1/; - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - &pinctrl_usdhc2 { - fsl,pins = < -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts -old mode 100755 -new mode 100644 -index bd7705d6d7a5..c5e542942aaf ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts -@@ -1,143 +1,8 @@ - // SPDX-License-Identifier: (GPL-2.0+ OR MIT) - /* -- * Copyright 2019-2020 NXP -+ * Copyright 2021 Foundries.IO - */ - - /dts-v1/; - --#include --#include "imx8mm-evk.dtsi" -- --/ { -- model = "FSL i.MX8MM EVK board"; -- compatible = "fsl,imx8mm-evk", "fsl,imx8mm"; -- -- aliases { -- spi0 = &flexspi; -- }; -- -- usdhc1_pwrseq: usdhc1_pwrseq { -- compatible = "mmc-pwrseq-simple"; -- pinctrl-names = "default"; -- pinctrl-0 = <&pinctrl_usdhc1_gpio>; -- reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; -- }; --}; -- --&flexspi { -- pinctrl-names = "default"; -- pinctrl-0 = <&pinctrl_flexspi>; -- status = "okay"; -- -- flash@0 { -- reg = <0>; -- #address-cells = <1>; -- #size-cells = <1>; -- compatible = "jedec,spi-nor"; -- spi-max-frequency = <80000000>; -- spi-tx-bus-width = <1>; -- spi-rx-bus-width = <4>; -- }; --}; -- --&usdhc1 { -- pinctrl-names = "default", "state_100mhz", "state_200mhz"; -- pinctrl-0 = <&pinctrl_usdhc1>, <&pinctrl_wlan>; -- pinctrl-1 = <&pinctrl_usdhc1_100mhz>, <&pinctrl_wlan>; -- pinctrl-2 = <&pinctrl_usdhc1_200mhz>, <&pinctrl_wlan>; -- bus-width = <4>; -- keep-power-in-suspend; -- non-removable; -- wakeup-source; -- mmc-pwrseq = <&usdhc1_pwrseq>; -- fsl,sdio-async-interrupt-enabled; -- status = "okay"; -- -- wifi_wake_host { -- compatible = "nxp,wifi-wake-host"; -- interrupt-parent = <&gpio2>; -- interrupts = <9 IRQ_TYPE_LEVEL_LOW>; -- interrupt-names = "host-wake"; -- }; --}; -- --&usdhc3 { -- assigned-clocks = <&clk IMX8MM_CLK_USDHC3_ROOT>; -- assigned-clock-rates = <400000000>; -- pinctrl-names = "default", "state_100mhz", "state_200mhz"; -- pinctrl-0 = <&pinctrl_usdhc3>; -- pinctrl-1 = <&pinctrl_usdhc3_100mhz>; -- pinctrl-2 = <&pinctrl_usdhc3_200mhz>; -- bus-width = <8>; -- non-removable; -- status = "okay"; --}; -- --&iomuxc { -- pinctrl_flexspi: flexspigrp { -- fsl,pins = < -- MX8MM_IOMUXC_NAND_ALE_QSPI_A_SCLK 0x1c2 -- MX8MM_IOMUXC_NAND_CE0_B_QSPI_A_SS0_B 0x82 -- MX8MM_IOMUXC_NAND_DATA00_QSPI_A_DATA0 0x82 -- MX8MM_IOMUXC_NAND_DATA01_QSPI_A_DATA1 0x82 -- MX8MM_IOMUXC_NAND_DATA02_QSPI_A_DATA2 0x82 -- MX8MM_IOMUXC_NAND_DATA03_QSPI_A_DATA3 0x82 -- >; -- }; -- -- pinctrl_usdhc3: usdhc3grp { -- fsl,pins = < -- MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x190 -- MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d0 -- MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d0 -- MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d0 -- MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d0 -- MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d0 -- MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d0 -- MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d0 -- MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d0 -- MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d0 -- MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d0 -- MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x190 -- >; -- }; -- -- pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp { -- fsl,pins = < -- MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x194 -- MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d4 -- MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d4 -- MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d4 -- MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d4 -- MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d4 -- MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d4 -- MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d4 -- MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d4 -- MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d4 -- MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x194 -- >; -- }; -- -- pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp { -- fsl,pins = < -- MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x196 -- MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d6 -- MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d6 -- MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d6 -- MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d6 -- MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d6 -- MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d6 -- MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d6 -- MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d6 -- MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d6 -- MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x196 -- >; -- }; -- -- pinctrl_wlan: wlangrp { -- fsl,pins = < -- MX8MM_IOMUXC_GPIO1_IO00_ANAMIX_REF_CLK_32K 0x141 -- MX8MM_IOMUXC_SD1_DATA7_GPIO2_IO9 0x159 -- >; -- }; --}; -+#include "imx8mm-evk-qca-wifi.dts" -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts b/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts -new file mode 100644 -index 000000000000..7129fbb7c228 ---- /dev/null -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts -@@ -0,0 +1,142 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright 2019-2020 NXP -+ */ -+ -+/dts-v1/; -+ -+#include -+#include "imx8mm-evk.dtsi" -+ -+/ { -+ model = "FSL i.MX8MM EVKB board"; -+ compatible = "fsl,imx8mm-evkb", "fsl,imx8mm-evk", "fsl,imx8mm"; -+ -+ aliases { -+ spi0 = &flexspi; -+ }; -+ -+ usdhc1_pwrseq: usdhc1_pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_usdhc1_gpio>; -+ reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; -+ }; -+}; -+ -+&flexspi { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_flexspi>; -+ status = "okay"; -+ -+ flash@0 { -+ reg = <0>; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ compatible = "jedec,spi-nor"; -+ spi-max-frequency = <80000000>; -+ spi-tx-bus-width = <1>; -+ spi-rx-bus-width = <4>; -+ }; -+}; -+ -+&usdhc1 { -+ pinctrl-names = "default", "state_100mhz", "state_200mhz"; -+ pinctrl-0 = <&pinctrl_usdhc1>, <&pinctrl_wlan>; -+ pinctrl-1 = <&pinctrl_usdhc1_100mhz>, <&pinctrl_wlan>; -+ pinctrl-2 = <&pinctrl_usdhc1_200mhz>, <&pinctrl_wlan>; -+ keep-power-in-suspend; -+ non-removable; -+ wakeup-source; -+ mmc-pwrseq = <&usdhc1_pwrseq>; -+ fsl,sdio-async-interrupt-enabled; -+ status = "okay"; -+ -+ wifi_wake_host { -+ compatible = "nxp,wifi-wake-host"; -+ interrupt-parent = <&gpio2>; -+ interrupts = <9 IRQ_TYPE_LEVEL_LOW>; -+ interrupt-names = "host-wake"; -+ }; -+}; -+ -+&usdhc3 { -+ assigned-clocks = <&clk IMX8MM_CLK_USDHC3_ROOT>; -+ assigned-clock-rates = <400000000>; -+ pinctrl-names = "default", "state_100mhz", "state_200mhz"; -+ pinctrl-0 = <&pinctrl_usdhc3>; -+ pinctrl-1 = <&pinctrl_usdhc3_100mhz>; -+ pinctrl-2 = <&pinctrl_usdhc3_200mhz>; -+ bus-width = <8>; -+ non-removable; -+ status = "okay"; -+}; -+ -+&iomuxc { -+ pinctrl_flexspi: flexspigrp { -+ fsl,pins = < -+ MX8MM_IOMUXC_NAND_ALE_QSPI_A_SCLK 0x1c2 -+ MX8MM_IOMUXC_NAND_CE0_B_QSPI_A_SS0_B 0x82 -+ MX8MM_IOMUXC_NAND_DATA00_QSPI_A_DATA0 0x82 -+ MX8MM_IOMUXC_NAND_DATA01_QSPI_A_DATA1 0x82 -+ MX8MM_IOMUXC_NAND_DATA02_QSPI_A_DATA2 0x82 -+ MX8MM_IOMUXC_NAND_DATA03_QSPI_A_DATA3 0x82 -+ >; -+ }; -+ -+ pinctrl_usdhc3: usdhc3grp { -+ fsl,pins = < -+ MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x190 -+ MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d0 -+ MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d0 -+ MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d0 -+ MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d0 -+ MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d0 -+ MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d0 -+ MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d0 -+ MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d0 -+ MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d0 -+ MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d0 -+ MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x190 -+ >; -+ }; -+ -+ pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp { -+ fsl,pins = < -+ MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x194 -+ MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d4 -+ MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d4 -+ MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d4 -+ MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d4 -+ MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d4 -+ MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d4 -+ MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d4 -+ MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d4 -+ MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d4 -+ MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x194 -+ >; -+ }; -+ -+ pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp { -+ fsl,pins = < -+ MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x196 -+ MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d6 -+ MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d6 -+ MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d6 -+ MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d6 -+ MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d6 -+ MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d6 -+ MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d6 -+ MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d6 -+ MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d6 -+ MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x196 -+ >; -+ }; -+ -+ pinctrl_wlan: wlangrp { -+ fsl,pins = < -+ MX8MM_IOMUXC_GPIO1_IO00_ANAMIX_REF_CLK_32K 0x141 -+ MX8MM_IOMUXC_SD1_DATA7_GPIO2_IO9 0x159 -+ >; -+ }; -+}; --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0001-mm-introduce-new-lock_mm_and_find_vma-page-fault-hel.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0001-mm-introduce-new-lock_mm_and_find_vma-page-fault-hel.patch deleted file mode 100644 index 14cc9ad430..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0001-mm-introduce-new-lock_mm_and_find_vma-page-fault-hel.patch +++ /dev/null @@ -1,323 +0,0 @@ -From 14da9661819bd68d034f8579820a27f93bf9d110 Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Thu, 15 Jun 2023 15:17:36 -0700 -Subject: [PATCH 01/12] mm: introduce new 'lock_mm_and_find_vma()' page fault - helper - -commit c2508ec5a58db67093f4fb8bf89a9a7c53a109e9 upstream. - -.. and make x86 use it. - -This basically extracts the existing x86 "find and expand faulting vma" -code, but extends it to also take the mmap lock for writing in case we -actually do need to expand the vma. - -We've historically short-circuited that case, and have some rather ugly -special logic to serialize the stack segment expansion (since we only -hold the mmap lock for reading) that doesn't match the normal VM -locking. - -That slight violation of locking worked well, right up until it didn't: -the maple tree code really does want proper locking even for simple -extension of an existing vma. - -So extract the code for "look up the vma of the fault" from x86, fix it -up to do the necessary write locking, and make it available as a helper -function for other architectures that can use the common helper. - -Note: I say "common helper", but it really only handles the normal -stack-grows-down case. Which is all architectures except for PA-RISC -and IA64. So some rare architectures can't use the helper, but if they -care they'll just need to open-code this logic. - -It's also worth pointing out that this code really would like to have an -optimistic "mmap_upgrade_trylock()" to make it quicker to go from a -read-lock (for the common case) to taking the write lock (for having to -extend the vma) in the normal single-threaded situation where there is -no other locking activity. - -But that _is_ all the very uncommon special case, so while it would be -nice to have such an operation, it probably doesn't matter in reality. -I did put in the skeleton code for such a possible future expansion, -even if it only acts as pseudo-documentation for what we're doing. - -Signed-off-by: Linus Torvalds -[6.1: Ignore CONFIG_PER_VMA_LOCK context] -Signed-off-by: Samuel Mendoza-Jonas -Signed-off-by: David Woodhouse -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - arch/x86/Kconfig | 1 + - arch/x86/mm/fault.c | 56 ++------------------ - include/linux/mm.h | 2 + - mm/Kconfig | 4 ++ - mm/memory.c | 121 ++++++++++++++++++++++++++++++++++++++++++++ - 5 files changed, 132 insertions(+), 52 deletions(-) - -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 084befc203b3..ed4bd667d013 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -275,6 +275,7 @@ config X86 - select HAVE_GENERIC_VDSO - select HOTPLUG_SMT if SMP - select IRQ_FORCED_THREADING -+ select LOCK_MM_AND_FIND_VMA - select NEED_PER_CPU_EMBED_FIRST_CHUNK - select NEED_PER_CPU_PAGE_FIRST_CHUNK - select NEED_SG_DMA_LENGTH -diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c -index c7999b493865..ee4c458f7167 100644 ---- a/arch/x86/mm/fault.c -+++ b/arch/x86/mm/fault.c -@@ -352,7 +352,7 @@ static void dump_pagetable(unsigned long address) - - #ifdef CONFIG_CPU_SUP_AMD - static const char errata93_warning[] = --KERN_ERR -+KERN_ERR - "******* Your BIOS seems to not contain a fix for K8 errata #93\n" - "******* Working around it, but it may cause SEGVs or burn power.\n" - "******* Please consider a BIOS update.\n" -@@ -961,12 +961,6 @@ __bad_area(struct pt_regs *regs, unsigned long error_code, - __bad_area_nosemaphore(regs, error_code, address, pkey, si_code); - } - --static noinline void --bad_area(struct pt_regs *regs, unsigned long error_code, unsigned long address) --{ -- __bad_area(regs, error_code, address, 0, SEGV_MAPERR); --} -- - static inline bool bad_area_access_from_pkeys(unsigned long error_code, - struct vm_area_struct *vma) - { -@@ -1427,59 +1421,17 @@ void do_user_addr_fault(struct pt_regs *regs, - } - #endif - -- /* -- * Kernel-mode access to the user address space should only occur -- * on well-defined single instructions listed in the exception -- * tables. But, an erroneous kernel fault occurring outside one of -- * those areas which also holds mmap_lock might deadlock attempting -- * to validate the fault against the address space. -- * -- * Only do the expensive exception table search when we might be at -- * risk of a deadlock. This happens if we -- * 1. Failed to acquire mmap_lock, and -- * 2. The access did not originate in userspace. -- */ -- if (unlikely(!mmap_read_trylock(mm))) { -- if (!user_mode(regs) && !search_exception_tables(regs->ip)) { -- /* -- * Fault from code in kernel from -- * which we do not expect faults. -- */ -- bad_area_nosemaphore(regs, error_code, address); -- goto out; -- } - retry: -- mmap_read_lock(mm); -- } else { -- /* -- * The above down_read_trylock() might have succeeded in -- * which case we'll have missed the might_sleep() from -- * down_read(): -- */ -- might_sleep(); -- } -- -- vma = find_vma(mm, address); -+ vma = lock_mm_and_find_vma(mm, address, regs); - if (unlikely(!vma)) { -- bad_area(regs, error_code, address); -- goto out; -- } -- if (likely(vma->vm_start <= address)) -- goto good_area; -- if (unlikely(!(vma->vm_flags & VM_GROWSDOWN))) { -- bad_area(regs, error_code, address); -- goto out; -- } -- if (unlikely(expand_stack(vma, address))) { -- bad_area(regs, error_code, address); -- goto out; -+ bad_area_nosemaphore(regs, error_code, address); -+ return; - } - - /* - * Ok, we have a good vm_area for this memory access, so - * we can handle it.. - */ --good_area: - if (unlikely(access_error(error_code, vma))) { - bad_area_access_error(regs, error_code, address, vma); - goto out; -diff --git a/include/linux/mm.h b/include/linux/mm.h -index 5cdad74fcb97..5bf64ef5e562 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -1942,6 +1942,8 @@ void unmap_mapping_pages(struct address_space *mapping, - pgoff_t start, pgoff_t nr, bool even_cows); - void unmap_mapping_range(struct address_space *mapping, - loff_t const holebegin, loff_t const holelen, int even_cows); -+struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm, -+ unsigned long address, struct pt_regs *regs); - #else - static inline vm_fault_t handle_mm_fault(struct vm_area_struct *vma, - unsigned long address, unsigned int flags, -diff --git a/mm/Kconfig b/mm/Kconfig -index 57e1d8c5b505..35109a4a2f7c 100644 ---- a/mm/Kconfig -+++ b/mm/Kconfig -@@ -1150,6 +1150,10 @@ config LRU_GEN_STATS - This option has a per-memcg and per-node memory overhead. - # } - -+config LOCK_MM_AND_FIND_VMA -+ bool -+ depends on !STACK_GROWSUP -+ - source "mm/damon/Kconfig" - - endmenu -diff --git a/mm/memory.c b/mm/memory.c -index a05d5aa72a31..c0162f1f26b8 100644 ---- a/mm/memory.c -+++ b/mm/memory.c -@@ -5246,6 +5246,127 @@ vm_fault_t handle_mm_fault(struct vm_area_struct *vma, unsigned long address, - } - EXPORT_SYMBOL_GPL(handle_mm_fault); - -+#ifdef CONFIG_LOCK_MM_AND_FIND_VMA -+#include -+ -+static inline bool get_mmap_lock_carefully(struct mm_struct *mm, struct pt_regs *regs) -+{ -+ /* Even if this succeeds, make it clear we *might* have slept */ -+ if (likely(mmap_read_trylock(mm))) { -+ might_sleep(); -+ return true; -+ } -+ -+ if (regs && !user_mode(regs)) { -+ unsigned long ip = instruction_pointer(regs); -+ if (!search_exception_tables(ip)) -+ return false; -+ } -+ -+ mmap_read_lock(mm); -+ return true; -+} -+ -+static inline bool mmap_upgrade_trylock(struct mm_struct *mm) -+{ -+ /* -+ * We don't have this operation yet. -+ * -+ * It should be easy enough to do: it's basically a -+ * atomic_long_try_cmpxchg_acquire() -+ * from RWSEM_READER_BIAS -> RWSEM_WRITER_LOCKED, but -+ * it also needs the proper lockdep magic etc. -+ */ -+ return false; -+} -+ -+static inline bool upgrade_mmap_lock_carefully(struct mm_struct *mm, struct pt_regs *regs) -+{ -+ mmap_read_unlock(mm); -+ if (regs && !user_mode(regs)) { -+ unsigned long ip = instruction_pointer(regs); -+ if (!search_exception_tables(ip)) -+ return false; -+ } -+ mmap_write_lock(mm); -+ return true; -+} -+ -+/* -+ * Helper for page fault handling. -+ * -+ * This is kind of equivalend to "mmap_read_lock()" followed -+ * by "find_extend_vma()", except it's a lot more careful about -+ * the locking (and will drop the lock on failure). -+ * -+ * For example, if we have a kernel bug that causes a page -+ * fault, we don't want to just use mmap_read_lock() to get -+ * the mm lock, because that would deadlock if the bug were -+ * to happen while we're holding the mm lock for writing. -+ * -+ * So this checks the exception tables on kernel faults in -+ * order to only do this all for instructions that are actually -+ * expected to fault. -+ * -+ * We can also actually take the mm lock for writing if we -+ * need to extend the vma, which helps the VM layer a lot. -+ */ -+struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm, -+ unsigned long addr, struct pt_regs *regs) -+{ -+ struct vm_area_struct *vma; -+ -+ if (!get_mmap_lock_carefully(mm, regs)) -+ return NULL; -+ -+ vma = find_vma(mm, addr); -+ if (likely(vma && (vma->vm_start <= addr))) -+ return vma; -+ -+ /* -+ * Well, dang. We might still be successful, but only -+ * if we can extend a vma to do so. -+ */ -+ if (!vma || !(vma->vm_flags & VM_GROWSDOWN)) { -+ mmap_read_unlock(mm); -+ return NULL; -+ } -+ -+ /* -+ * We can try to upgrade the mmap lock atomically, -+ * in which case we can continue to use the vma -+ * we already looked up. -+ * -+ * Otherwise we'll have to drop the mmap lock and -+ * re-take it, and also look up the vma again, -+ * re-checking it. -+ */ -+ if (!mmap_upgrade_trylock(mm)) { -+ if (!upgrade_mmap_lock_carefully(mm, regs)) -+ return NULL; -+ -+ vma = find_vma(mm, addr); -+ if (!vma) -+ goto fail; -+ if (vma->vm_start <= addr) -+ goto success; -+ if (!(vma->vm_flags & VM_GROWSDOWN)) -+ goto fail; -+ } -+ -+ if (expand_stack(vma, addr)) -+ goto fail; -+ -+success: -+ mmap_write_downgrade(mm); -+ return vma; -+ -+fail: -+ mmap_write_unlock(mm); -+ return NULL; -+} -+#endif -+ - #ifndef __PAGETABLE_P4D_FOLDED - /* - * Allocate p4d page table. --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0002-mm-make-the-page-fault-mmap-locking-killable.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0002-mm-make-the-page-fault-mmap-locking-killable.patch deleted file mode 100644 index 6573a9d48f..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0002-mm-make-the-page-fault-mmap-locking-killable.patch +++ /dev/null @@ -1,54 +0,0 @@ -From a06917a9cb2045be3ecedeee7dbf779b6e45b6ef Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Thu, 15 Jun 2023 16:17:48 -0700 -Subject: [PATCH 02/12] mm: make the page fault mmap locking killable - -commit eda0047296a16d65a7f2bc60a408f70d178b2014 upstream. - -This is done as a separate patch from introducing the new -lock_mm_and_find_vma() helper, because while it's an obvious change, -it's not what x86 used to do in this area. - -We already abort the page fault on fatal signals anyway, so why should -we wait for the mmap lock only to then abort later? With the new helper -function that returns without the lock held on failure anyway, this is -particularly easy and straightforward. - -Signed-off-by: Linus Torvalds -Signed-off-by: Samuel Mendoza-Jonas -Signed-off-by: David Woodhouse -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - mm/memory.c | 6 ++---- - 1 file changed, 2 insertions(+), 4 deletions(-) - -diff --git a/mm/memory.c b/mm/memory.c -index c0162f1f26b8..329340b2a56b 100644 ---- a/mm/memory.c -+++ b/mm/memory.c -@@ -5263,8 +5263,7 @@ static inline bool get_mmap_lock_carefully(struct mm_struct *mm, struct pt_regs - return false; - } - -- mmap_read_lock(mm); -- return true; -+ return !mmap_read_lock_killable(mm); - } - - static inline bool mmap_upgrade_trylock(struct mm_struct *mm) -@@ -5288,8 +5287,7 @@ static inline bool upgrade_mmap_lock_carefully(struct mm_struct *mm, struct pt_r - if (!search_exception_tables(ip)) - return false; - } -- mmap_write_lock(mm); -- return true; -+ return !mmap_write_lock_killable(mm); - } - - /* --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0003-arm64-mm-Convert-to-using-lock_mm_and_find_vma.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0003-arm64-mm-Convert-to-using-lock_mm_and_find_vma.patch deleted file mode 100644 index 0ac63d278c..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0003-arm64-mm-Convert-to-using-lock_mm_and_find_vma.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 91ccbbb62b1cf14f094879c610c78eb99b69818c Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Thu, 15 Jun 2023 17:11:44 -0700 -Subject: [PATCH 03/12] arm64/mm: Convert to using lock_mm_and_find_vma() - -commit ae870a68b5d13d67cf4f18d47bb01ee3fee40acb upstream. - -This converts arm64 to use the new page fault helper. It was very -straightforward, but still needed a fix for the "obvious" conversion I -initially did. Thanks to Suren for the fix and testing. - -Fixed-and-tested-by: Suren Baghdasaryan -Unnecessary-code-removal-by: Liam R. Howlett -Signed-off-by: Linus Torvalds -[6.1: Ignore CONFIG_PER_VMA_LOCK context] -Signed-off-by: Samuel Mendoza-Jonas -Signed-off-by: David Woodhouse -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - arch/arm64/Kconfig | 1 + - arch/arm64/mm/fault.c | 46 +++++++++---------------------------------- - 2 files changed, 10 insertions(+), 37 deletions(-) - -diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 706668f8e372..016862efeb44 100644 ---- a/arch/arm64/Kconfig -+++ b/arch/arm64/Kconfig -@@ -214,6 +214,7 @@ config ARM64 - select IRQ_DOMAIN - select IRQ_FORCED_THREADING - select KASAN_VMALLOC if KASAN -+ select LOCK_MM_AND_FIND_VMA - select MODULES_USE_ELF_RELA - select NEED_DMA_MAP_STATE - select NEED_SG_DMA_LENGTH -diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c -index 9a59278c95bb..ff743cac83ab 100644 ---- a/arch/arm64/mm/fault.c -+++ b/arch/arm64/mm/fault.c -@@ -491,27 +491,14 @@ static void do_bad_area(unsigned long far, unsigned long esr, - #define VM_FAULT_BADMAP 0x010000 - #define VM_FAULT_BADACCESS 0x020000 - --static vm_fault_t __do_page_fault(struct mm_struct *mm, unsigned long addr, -+static vm_fault_t __do_page_fault(struct mm_struct *mm, -+ struct vm_area_struct *vma, unsigned long addr, - unsigned int mm_flags, unsigned long vm_flags, - struct pt_regs *regs) - { -- struct vm_area_struct *vma = find_vma(mm, addr); -- -- if (unlikely(!vma)) -- return VM_FAULT_BADMAP; -- - /* - * Ok, we have a good vm_area for this memory access, so we can handle - * it. -- */ -- if (unlikely(vma->vm_start > addr)) { -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- return VM_FAULT_BADMAP; -- if (expand_stack(vma, addr)) -- return VM_FAULT_BADMAP; -- } -- -- /* - * Check that the permissions on the VMA allow for the fault which - * occurred. - */ -@@ -543,6 +530,7 @@ static int __kprobes do_page_fault(unsigned long far, unsigned long esr, - unsigned long vm_flags; - unsigned int mm_flags = FAULT_FLAG_DEFAULT; - unsigned long addr = untagged_addr(far); -+ struct vm_area_struct *vma; - - if (kprobe_page_fault(regs, esr)) - return 0; -@@ -595,31 +583,14 @@ static int __kprobes do_page_fault(unsigned long far, unsigned long esr, - - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr); - -- /* -- * As per x86, we may deadlock here. However, since the kernel only -- * validly references user space from well defined areas of the code, -- * we can bug out early if this is from code which shouldn't. -- */ -- if (!mmap_read_trylock(mm)) { -- if (!user_mode(regs) && !search_exception_tables(regs->pc)) -- goto no_context; - retry: -- mmap_read_lock(mm); -- } else { -- /* -- * The above mmap_read_trylock() might have succeeded in which -- * case, we'll have missed the might_sleep() from down_read(). -- */ -- might_sleep(); --#ifdef CONFIG_DEBUG_VM -- if (!user_mode(regs) && !search_exception_tables(regs->pc)) { -- mmap_read_unlock(mm); -- goto no_context; -- } --#endif -+ vma = lock_mm_and_find_vma(mm, addr, regs); -+ if (unlikely(!vma)) { -+ fault = VM_FAULT_BADMAP; -+ goto done; - } - -- fault = __do_page_fault(mm, addr, mm_flags, vm_flags, regs); -+ fault = __do_page_fault(mm, vma, addr, mm_flags, vm_flags, regs); - - /* Quick path to respond to signals */ - if (fault_signal_pending(fault, regs)) { -@@ -638,6 +609,7 @@ static int __kprobes do_page_fault(unsigned long far, unsigned long esr, - } - mmap_read_unlock(mm); - -+done: - /* - * Handle the "normal" (no error) case first. - */ --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0004-mm-fault-convert-remaining-simple-cases-to-lock_mm_a.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0004-mm-fault-convert-remaining-simple-cases-to-lock_mm_a.patch deleted file mode 100644 index 600515342c..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0004-mm-fault-convert-remaining-simple-cases-to-lock_mm_a.patch +++ /dev/null @@ -1,532 +0,0 @@ -From 98533a074823adb43c869eaebfa2ddc914a3f336 Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Sat, 24 Jun 2023 10:55:38 -0700 -Subject: [PATCH 04/12] mm/fault: convert remaining simple cases to - lock_mm_and_find_vma() - -commit a050ba1e7422f2cc60ff8bfde3f96d34d00cb585 upstream. - -This does the simple pattern conversion of alpha, arc, csky, hexagon, -loongarch, nios2, sh, sparc32, and xtensa to the lock_mm_and_find_vma() -helper. They all have the regular fault handling pattern without odd -special cases. - -The remaining architectures all have something that keeps us from a -straightforward conversion: ia64 and parisc have stacks that can grow -both up as well as down (and ia64 has special address region checks). - -And m68k, microblaze, openrisc, sparc64, and um end up having extra -rules about only expanding the stack down a limited amount below the -user space stack pointer. That is something that x86 used to do too -(long long ago), and it probably could just be skipped, but it still -makes the conversion less than trivial. - -Note that this conversion was done manually and with the exception of -alpha without any build testing, because I have a fairly limited cross- -building environment. The cases are all simple, and I went through the -changes several times, but... - -Signed-off-by: Linus Torvalds -Signed-off-by: Samuel Mendoza-Jonas -Signed-off-by: David Woodhouse -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - arch/alpha/Kconfig | 1 + - arch/alpha/mm/fault.c | 13 +++---------- - arch/arc/Kconfig | 1 + - arch/arc/mm/fault.c | 11 +++-------- - arch/csky/Kconfig | 1 + - arch/csky/mm/fault.c | 22 +++++----------------- - arch/hexagon/Kconfig | 1 + - arch/hexagon/mm/vm_fault.c | 18 ++++-------------- - arch/loongarch/Kconfig | 1 + - arch/loongarch/mm/fault.c | 16 ++++++---------- - arch/nios2/Kconfig | 1 + - arch/nios2/mm/fault.c | 17 ++--------------- - arch/sh/Kconfig | 1 + - arch/sh/mm/fault.c | 17 ++--------------- - arch/sparc/Kconfig | 1 + - arch/sparc/mm/fault_32.c | 32 ++++++++------------------------ - arch/xtensa/Kconfig | 1 + - arch/xtensa/mm/fault.c | 14 +++----------- - 18 files changed, 45 insertions(+), 124 deletions(-) - -diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig -index 97fce7386b00..d95d82abdf29 100644 ---- a/arch/alpha/Kconfig -+++ b/arch/alpha/Kconfig -@@ -28,6 +28,7 @@ config ALPHA - select GENERIC_SMP_IDLE_THREAD - select HAVE_ARCH_AUDITSYSCALL - select HAVE_MOD_ARCH_SPECIFIC -+ select LOCK_MM_AND_FIND_VMA - select MODULES_USE_ELF_RELA - select ODD_RT_SIGACTION - select OLD_SIGSUSPEND -diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c -index ef427a6bdd1a..2b49aa94e4de 100644 ---- a/arch/alpha/mm/fault.c -+++ b/arch/alpha/mm/fault.c -@@ -119,20 +119,12 @@ do_page_fault(unsigned long address, unsigned long mmcsr, - flags |= FAULT_FLAG_USER; - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); - retry: -- mmap_read_lock(mm); -- vma = find_vma(mm, address); -+ vma = lock_mm_and_find_vma(mm, address, regs); - if (!vma) -- goto bad_area; -- if (vma->vm_start <= address) -- goto good_area; -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- goto bad_area; -- if (expand_stack(vma, address)) -- goto bad_area; -+ goto bad_area_nosemaphore; - - /* Ok, we have a good vm_area for this memory access, so - we can handle it. */ -- good_area: - si_code = SEGV_ACCERR; - if (cause < 0) { - if (!(vma->vm_flags & VM_EXEC)) -@@ -189,6 +181,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr, - bad_area: - mmap_read_unlock(mm); - -+ bad_area_nosemaphore: - if (user_mode(regs)) - goto do_sigsegv; - -diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig -index d9a13ccf89a3..cb1074f74c3f 100644 ---- a/arch/arc/Kconfig -+++ b/arch/arc/Kconfig -@@ -41,6 +41,7 @@ config ARC - select HAVE_PERF_EVENTS - select HAVE_SYSCALL_TRACEPOINTS - select IRQ_DOMAIN -+ select LOCK_MM_AND_FIND_VMA - select MODULES_USE_ELF_RELA - select OF - select OF_EARLY_FLATTREE -diff --git a/arch/arc/mm/fault.c b/arch/arc/mm/fault.c -index 5ca59a482632..f59e722d147f 100644 ---- a/arch/arc/mm/fault.c -+++ b/arch/arc/mm/fault.c -@@ -113,15 +113,9 @@ void do_page_fault(unsigned long address, struct pt_regs *regs) - - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); - retry: -- mmap_read_lock(mm); -- -- vma = find_vma(mm, address); -+ vma = lock_mm_and_find_vma(mm, address, regs); - if (!vma) -- goto bad_area; -- if (unlikely(address < vma->vm_start)) { -- if (!(vma->vm_flags & VM_GROWSDOWN) || expand_stack(vma, address)) -- goto bad_area; -- } -+ goto bad_area_nosemaphore; - - /* - * vm_area is good, now check permissions for this memory access -@@ -161,6 +155,7 @@ void do_page_fault(unsigned long address, struct pt_regs *regs) - bad_area: - mmap_read_unlock(mm); - -+bad_area_nosemaphore: - /* - * Major/minor page fault accounting - * (in case of retry we only land here once) -diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig -index adee6ab36862..742009123fd5 100644 ---- a/arch/csky/Kconfig -+++ b/arch/csky/Kconfig -@@ -96,6 +96,7 @@ config CSKY - select HAVE_RSEQ - select HAVE_STACKPROTECTOR - select HAVE_SYSCALL_TRACEPOINTS -+ select LOCK_MM_AND_FIND_VMA - select MAY_HAVE_SPARSE_IRQ - select MODULES_USE_ELF_RELA if MODULES - select OF -diff --git a/arch/csky/mm/fault.c b/arch/csky/mm/fault.c -index e15f736cca4b..ae9781b7d92e 100644 ---- a/arch/csky/mm/fault.c -+++ b/arch/csky/mm/fault.c -@@ -97,13 +97,12 @@ static inline void mm_fault_error(struct pt_regs *regs, unsigned long addr, vm_f - BUG(); - } - --static inline void bad_area(struct pt_regs *regs, struct mm_struct *mm, int code, unsigned long addr) -+static inline void bad_area_nosemaphore(struct pt_regs *regs, struct mm_struct *mm, int code, unsigned long addr) - { - /* - * Something tried to access memory that isn't in our memory map. - * Fix it, but check if it's kernel or user first. - */ -- mmap_read_unlock(mm); - /* User mode accesses just cause a SIGSEGV */ - if (user_mode(regs)) { - do_trap(regs, SIGSEGV, code, addr); -@@ -238,20 +237,9 @@ asmlinkage void do_page_fault(struct pt_regs *regs) - if (is_write(regs)) - flags |= FAULT_FLAG_WRITE; - retry: -- mmap_read_lock(mm); -- vma = find_vma(mm, addr); -+ vma = lock_mm_and_find_vma(mm, address, regs); - if (unlikely(!vma)) { -- bad_area(regs, mm, code, addr); -- return; -- } -- if (likely(vma->vm_start <= addr)) -- goto good_area; -- if (unlikely(!(vma->vm_flags & VM_GROWSDOWN))) { -- bad_area(regs, mm, code, addr); -- return; -- } -- if (unlikely(expand_stack(vma, addr))) { -- bad_area(regs, mm, code, addr); -+ bad_area_nosemaphore(regs, mm, code, addr); - return; - } - -@@ -259,11 +247,11 @@ asmlinkage void do_page_fault(struct pt_regs *regs) - * Ok, we have a good vm_area for this memory access, so - * we can handle it. - */ --good_area: - code = SEGV_ACCERR; - - if (unlikely(access_error(regs, vma))) { -- bad_area(regs, mm, code, addr); -+ mmap_read_unlock(mm); -+ bad_area_nosemaphore(regs, mm, code, addr); - return; - } - -diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig -index 54eadf265178..6726f4941015 100644 ---- a/arch/hexagon/Kconfig -+++ b/arch/hexagon/Kconfig -@@ -28,6 +28,7 @@ config HEXAGON - select GENERIC_SMP_IDLE_THREAD - select STACKTRACE_SUPPORT - select GENERIC_CLOCKEVENTS_BROADCAST -+ select LOCK_MM_AND_FIND_VMA - select MODULES_USE_ELF_RELA - select GENERIC_CPU_DEVICES - select ARCH_WANT_LD_ORPHAN_WARN -diff --git a/arch/hexagon/mm/vm_fault.c b/arch/hexagon/mm/vm_fault.c -index f73c7cbfe326..583b08727166 100644 ---- a/arch/hexagon/mm/vm_fault.c -+++ b/arch/hexagon/mm/vm_fault.c -@@ -57,21 +57,10 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs) - - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); - retry: -- mmap_read_lock(mm); -- vma = find_vma(mm, address); -- if (!vma) -- goto bad_area; -+ vma = lock_mm_and_find_vma(mm, address, regs); -+ if (unlikely(!vma)) -+ goto bad_area_nosemaphore; - -- if (vma->vm_start <= address) -- goto good_area; -- -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- goto bad_area; -- -- if (expand_stack(vma, address)) -- goto bad_area; -- --good_area: - /* Address space is OK. Now check access rights. */ - si_code = SEGV_ACCERR; - -@@ -140,6 +129,7 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs) - bad_area: - mmap_read_unlock(mm); - -+bad_area_nosemaphore: - if (user_mode(regs)) { - force_sig_fault(SIGSEGV, si_code, (void __user *)address); - return; -diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig -index 903096bd87f8..51d738ac12e5 100644 ---- a/arch/loongarch/Kconfig -+++ b/arch/loongarch/Kconfig -@@ -107,6 +107,7 @@ config LOONGARCH - select HAVE_VIRT_CPU_ACCOUNTING_GEN if !SMP - select IRQ_FORCED_THREADING - select IRQ_LOONGARCH_CPU -+ select LOCK_MM_AND_FIND_VMA - select MMU_GATHER_MERGE_VMAS if MMU - select MODULES_USE_ELF_RELA if MODULES - select NEED_PER_CPU_EMBED_FIRST_CHUNK -diff --git a/arch/loongarch/mm/fault.c b/arch/loongarch/mm/fault.c -index 1ccd53655cab..b829ab911a17 100644 ---- a/arch/loongarch/mm/fault.c -+++ b/arch/loongarch/mm/fault.c -@@ -166,22 +166,18 @@ static void __kprobes __do_page_fault(struct pt_regs *regs, - - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); - retry: -- mmap_read_lock(mm); -- vma = find_vma(mm, address); -- if (!vma) -- goto bad_area; -- if (vma->vm_start <= address) -- goto good_area; -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- goto bad_area; -- if (!expand_stack(vma, address)) -- goto good_area; -+ vma = lock_mm_and_find_vma(mm, address, regs); -+ if (unlikely(!vma)) -+ goto bad_area_nosemaphore; -+ goto good_area; -+ - /* - * Something tried to access memory that isn't in our memory map.. - * Fix it, but check if it's kernel or user first.. - */ - bad_area: - mmap_read_unlock(mm); -+bad_area_nosemaphore: - do_sigsegv(regs, write, address, si_code); - return; - -diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig -index a582f72104f3..1fb78865a459 100644 ---- a/arch/nios2/Kconfig -+++ b/arch/nios2/Kconfig -@@ -16,6 +16,7 @@ config NIOS2 - select HAVE_ARCH_TRACEHOOK - select HAVE_ARCH_KGDB - select IRQ_DOMAIN -+ select LOCK_MM_AND_FIND_VMA - select MODULES_USE_ELF_RELA - select OF - select OF_EARLY_FLATTREE -diff --git a/arch/nios2/mm/fault.c b/arch/nios2/mm/fault.c -index edaca0a6c1c1..71939fb28c2e 100644 ---- a/arch/nios2/mm/fault.c -+++ b/arch/nios2/mm/fault.c -@@ -86,27 +86,14 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long cause, - - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); - -- if (!mmap_read_trylock(mm)) { -- if (!user_mode(regs) && !search_exception_tables(regs->ea)) -- goto bad_area_nosemaphore; - retry: -- mmap_read_lock(mm); -- } -- -- vma = find_vma(mm, address); -+ vma = lock_mm_and_find_vma(mm, address, regs); - if (!vma) -- goto bad_area; -- if (vma->vm_start <= address) -- goto good_area; -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- goto bad_area; -- if (expand_stack(vma, address)) -- goto bad_area; -+ goto bad_area_nosemaphore; - /* - * Ok, we have a good vm_area for this memory access, so - * we can handle it.. - */ --good_area: - code = SEGV_ACCERR; - - switch (cause) { -diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig -index 5f220e903e5a..8e4d1f757bcc 100644 ---- a/arch/sh/Kconfig -+++ b/arch/sh/Kconfig -@@ -56,6 +56,7 @@ config SUPERH - select HAVE_STACKPROTECTOR - select HAVE_SYSCALL_TRACEPOINTS - select IRQ_FORCED_THREADING -+ select LOCK_MM_AND_FIND_VMA - select MODULES_USE_ELF_RELA - select NEED_SG_DMA_LENGTH - select NO_DMA if !MMU && !DMA_COHERENT -diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c -index acd2f5e50bfc..06e6b4952924 100644 ---- a/arch/sh/mm/fault.c -+++ b/arch/sh/mm/fault.c -@@ -439,21 +439,9 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, - } - - retry: -- mmap_read_lock(mm); -- -- vma = find_vma(mm, address); -+ vma = lock_mm_and_find_vma(mm, address, regs); - if (unlikely(!vma)) { -- bad_area(regs, error_code, address); -- return; -- } -- if (likely(vma->vm_start <= address)) -- goto good_area; -- if (unlikely(!(vma->vm_flags & VM_GROWSDOWN))) { -- bad_area(regs, error_code, address); -- return; -- } -- if (unlikely(expand_stack(vma, address))) { -- bad_area(regs, error_code, address); -+ bad_area_nosemaphore(regs, error_code, address); - return; - } - -@@ -461,7 +449,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, - * Ok, we have a good vm_area for this memory access, so - * we can handle it.. - */ --good_area: - if (unlikely(access_error(error_code, vma))) { - bad_area_access_error(regs, error_code, address); - return; -diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig -index 84437a4c6545..dbb1760cbe8c 100644 ---- a/arch/sparc/Kconfig -+++ b/arch/sparc/Kconfig -@@ -56,6 +56,7 @@ config SPARC32 - select DMA_DIRECT_REMAP - select GENERIC_ATOMIC64 - select HAVE_UID16 -+ select LOCK_MM_AND_FIND_VMA - select OLD_SIGACTION - select ZONE_DMA - -diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c -index 91259f291c54..aef2aebe2379 100644 ---- a/arch/sparc/mm/fault_32.c -+++ b/arch/sparc/mm/fault_32.c -@@ -143,28 +143,19 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, - if (pagefault_disabled() || !mm) - goto no_context; - -+ if (!from_user && address >= PAGE_OFFSET) -+ goto no_context; -+ - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); - - retry: -- mmap_read_lock(mm); -- -- if (!from_user && address >= PAGE_OFFSET) -- goto bad_area; -- -- vma = find_vma(mm, address); -+ vma = lock_mm_and_find_vma(mm, address, regs); - if (!vma) -- goto bad_area; -- if (vma->vm_start <= address) -- goto good_area; -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- goto bad_area; -- if (expand_stack(vma, address)) -- goto bad_area; -+ goto bad_area_nosemaphore; - /* - * Ok, we have a good vm_area for this memory access, so - * we can handle it.. - */ --good_area: - code = SEGV_ACCERR; - if (write) { - if (!(vma->vm_flags & VM_WRITE)) -@@ -318,17 +309,9 @@ static void force_user_fault(unsigned long address, int write) - - code = SEGV_MAPERR; - -- mmap_read_lock(mm); -- vma = find_vma(mm, address); -+ vma = lock_mm_and_find_vma(mm, address, regs); - if (!vma) -- goto bad_area; -- if (vma->vm_start <= address) -- goto good_area; -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- goto bad_area; -- if (expand_stack(vma, address)) -- goto bad_area; --good_area: -+ goto bad_area_nosemaphore; - code = SEGV_ACCERR; - if (write) { - if (!(vma->vm_flags & VM_WRITE)) -@@ -347,6 +330,7 @@ static void force_user_fault(unsigned long address, int write) - return; - bad_area: - mmap_read_unlock(mm); -+bad_area_nosemaphore: - __do_fault_siginfo(code, SIGSEGV, tsk->thread.kregs, address); - return; - -diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig -index bcb0c5d2abc2..6d3c9257aa13 100644 ---- a/arch/xtensa/Kconfig -+++ b/arch/xtensa/Kconfig -@@ -49,6 +49,7 @@ config XTENSA - select HAVE_SYSCALL_TRACEPOINTS - select HAVE_VIRT_CPU_ACCOUNTING_GEN - select IRQ_DOMAIN -+ select LOCK_MM_AND_FIND_VMA - select MODULES_USE_ELF_RELA - select PERF_USE_VMALLOC - select TRACE_IRQFLAGS_SUPPORT -diff --git a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c -index 8c781b05c0bd..d89b193c779f 100644 ---- a/arch/xtensa/mm/fault.c -+++ b/arch/xtensa/mm/fault.c -@@ -130,23 +130,14 @@ void do_page_fault(struct pt_regs *regs) - perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); - - retry: -- mmap_read_lock(mm); -- vma = find_vma(mm, address); -- -+ vma = lock_mm_and_find_vma(mm, address, regs); - if (!vma) -- goto bad_area; -- if (vma->vm_start <= address) -- goto good_area; -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- goto bad_area; -- if (expand_stack(vma, address)) -- goto bad_area; -+ goto bad_area_nosemaphore; - - /* Ok, we have a good vm_area for this memory access, so - * we can handle it.. - */ - --good_area: - code = SEGV_ACCERR; - - if (is_write) { -@@ -205,6 +196,7 @@ void do_page_fault(struct pt_regs *regs) - */ - bad_area: - mmap_read_unlock(mm); -+bad_area_nosemaphore: - if (user_mode(regs)) { - current->thread.bad_vaddr = address; - current->thread.error_code = is_write; --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0005-powerpc-mm-convert-coprocessor-fault-to-lock_mm_and_.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0005-powerpc-mm-convert-coprocessor-fault-to-lock_mm_and_.patch deleted file mode 100644 index 35f4a33de4..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0005-powerpc-mm-convert-coprocessor-fault-to-lock_mm_and_.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 44b3e6081517fcd6f95a925abda7d4d729c58b39 Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Sat, 24 Jun 2023 11:17:05 -0700 -Subject: [PATCH 05/12] powerpc/mm: convert coprocessor fault to - lock_mm_and_find_vma() - -commit 2cd76c50d0b41cec5c87abfcdf25b236a2793fb6 upstream. - -This is one of the simple cases, except there's no pt_regs pointer. -Which is fine, as lock_mm_and_find_vma() is set up to work fine with a -NULL pt_regs. - -Powerpc already enabled LOCK_MM_AND_FIND_VMA for the main CPU faulting, -so we can just use the helper without any extra work. - -Signed-off-by: Linus Torvalds -Signed-off-by: Samuel Mendoza-Jonas -Signed-off-by: David Woodhouse -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - arch/powerpc/mm/copro_fault.c | 14 +++----------- - 1 file changed, 3 insertions(+), 11 deletions(-) - -diff --git a/arch/powerpc/mm/copro_fault.c b/arch/powerpc/mm/copro_fault.c -index 7c507fb48182..f49fd873df8d 100644 ---- a/arch/powerpc/mm/copro_fault.c -+++ b/arch/powerpc/mm/copro_fault.c -@@ -33,19 +33,11 @@ int copro_handle_mm_fault(struct mm_struct *mm, unsigned long ea, - if (mm->pgd == NULL) - return -EFAULT; - -- mmap_read_lock(mm); -- ret = -EFAULT; -- vma = find_vma(mm, ea); -+ vma = lock_mm_and_find_vma(mm, ea, NULL); - if (!vma) -- goto out_unlock; -- -- if (ea < vma->vm_start) { -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- goto out_unlock; -- if (expand_stack(vma, ea)) -- goto out_unlock; -- } -+ return -EFAULT; - -+ ret = -EFAULT; - is_write = dsisr & DSISR_ISSTORE; - if (is_write) { - if (!(vma->vm_flags & VM_WRITE)) --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0006-mm-make-find_extend_vma-fail-if-write-lock-not-held.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0006-mm-make-find_extend_vma-fail-if-write-lock-not-held.patch deleted file mode 100644 index 8256736edc..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0006-mm-make-find_extend_vma-fail-if-write-lock-not-held.patch +++ /dev/null @@ -1,260 +0,0 @@ -From 357aa6d0c6a2dc585c4b94d46326538b5bec0aba Mon Sep 17 00:00:00 2001 -From: "Liam R. Howlett" -Date: Fri, 16 Jun 2023 15:58:54 -0700 -Subject: [PATCH 06/12] mm: make find_extend_vma() fail if write lock not held - -commit f440fa1ac955e2898893f9301568435eb5cdfc4b upstream. - -Make calls to extend_vma() and find_extend_vma() fail if the write lock -is required. - -To avoid making this a flag-day event, this still allows the old -read-locking case for the trivial situations, and passes in a flag to -say "is it write-locked". That way write-lockers can say "yes, I'm -being careful", and legacy users will continue to work in all the common -cases until they have been fully converted to the new world order. - -Co-Developed-by: Matthew Wilcox (Oracle) -Signed-off-by: Matthew Wilcox (Oracle) -Signed-off-by: Liam R. Howlett -Signed-off-by: Linus Torvalds -Signed-off-by: Samuel Mendoza-Jonas -Signed-off-by: David Woodhouse -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - fs/binfmt_elf.c | 6 +++--- - fs/exec.c | 5 +++-- - include/linux/mm.h | 10 +++++++--- - mm/memory.c | 2 +- - mm/mmap.c | 50 ++++++++++++++++++++++++++++++---------------- - mm/nommu.c | 3 ++- - 6 files changed, 49 insertions(+), 27 deletions(-) - -diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c -index 444302afc673..5688c3e6adc1 100644 ---- a/fs/binfmt_elf.c -+++ b/fs/binfmt_elf.c -@@ -315,10 +315,10 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, - * Grow the stack manually; some architectures have a limit on how - * far ahead a user-space access may be in order to grow the stack. - */ -- if (mmap_read_lock_killable(mm)) -+ if (mmap_write_lock_killable(mm)) - return -EINTR; -- vma = find_extend_vma(mm, bprm->p); -- mmap_read_unlock(mm); -+ vma = find_extend_vma_locked(mm, bprm->p, true); -+ mmap_write_unlock(mm); - if (!vma) - return -EFAULT; - -diff --git a/fs/exec.c b/fs/exec.c -index 4757e8b25233..b192cb1d4364 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -204,7 +204,8 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, - - #ifdef CONFIG_STACK_GROWSUP - if (write) { -- ret = expand_downwards(bprm->vma, pos); -+ /* We claim to hold the lock - nobody to race with */ -+ ret = expand_downwards(bprm->vma, pos, true); - if (ret < 0) - return NULL; - } -@@ -855,7 +856,7 @@ int setup_arg_pages(struct linux_binprm *bprm, - stack_base = vma->vm_start - stack_expand; - #endif - current->mm->start_stack = bprm->p; -- ret = expand_stack(vma, stack_base); -+ ret = expand_stack_locked(vma, stack_base, true); - if (ret) - ret = -EFAULT; - -diff --git a/include/linux/mm.h b/include/linux/mm.h -index 5bf64ef5e562..d4153b26607d 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -2820,11 +2820,13 @@ extern vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf); - - extern unsigned long stack_guard_gap; - /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ --extern int expand_stack(struct vm_area_struct *vma, unsigned long address); -+int expand_stack_locked(struct vm_area_struct *vma, unsigned long address, -+ bool write_locked); -+#define expand_stack(vma,addr) expand_stack_locked(vma,addr,false) - - /* CONFIG_STACK_GROWSUP still needs to grow downwards at some places */ --extern int expand_downwards(struct vm_area_struct *vma, -- unsigned long address); -+int expand_downwards(struct vm_area_struct *vma, unsigned long address, -+ bool write_locked); - #if VM_GROWSUP - extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); - #else -@@ -2925,6 +2927,8 @@ unsigned long change_prot_numa(struct vm_area_struct *vma, - #endif - - struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); -+struct vm_area_struct *find_extend_vma_locked(struct mm_struct *, -+ unsigned long addr, bool write_locked); - int remap_pfn_range(struct vm_area_struct *, unsigned long addr, - unsigned long pfn, unsigned long size, pgprot_t); - int remap_pfn_range_notrack(struct vm_area_struct *vma, unsigned long addr, -diff --git a/mm/memory.c b/mm/memory.c -index 329340b2a56b..72ee449be39b 100644 ---- a/mm/memory.c -+++ b/mm/memory.c -@@ -5352,7 +5352,7 @@ struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm, - goto fail; - } - -- if (expand_stack(vma, addr)) -+ if (expand_stack_locked(vma, addr, true)) - goto fail; - - success: -diff --git a/mm/mmap.c b/mm/mmap.c -index fe1db604dc49..5b9419c5b5c4 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -1907,7 +1907,8 @@ static int acct_stack_growth(struct vm_area_struct *vma, - * PA-RISC uses this for its stack; IA64 for its Register Backing Store. - * vma is the last one with address > vma->vm_end. Have to extend vma. - */ --int expand_upwards(struct vm_area_struct *vma, unsigned long address) -+int expand_upwards(struct vm_area_struct *vma, unsigned long address, -+ bool write_locked) - { - struct mm_struct *mm = vma->vm_mm; - struct vm_area_struct *next; -@@ -1931,6 +1932,8 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) - if (gap_addr < address || gap_addr > TASK_SIZE) - gap_addr = TASK_SIZE; - -+ if (!write_locked) -+ return -EAGAIN; - next = find_vma_intersection(mm, vma->vm_end, gap_addr); - if (next && vma_is_accessible(next)) { - if (!(next->vm_flags & VM_GROWSUP)) -@@ -1999,7 +2002,8 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) - /* - * vma is the first one with address < vma->vm_start. Have to extend vma. - */ --int expand_downwards(struct vm_area_struct *vma, unsigned long address) -+int expand_downwards(struct vm_area_struct *vma, unsigned long address, -+ bool write_locked) - { - struct mm_struct *mm = vma->vm_mm; - MA_STATE(mas, &mm->mm_mt, vma->vm_start, vma->vm_start); -@@ -2013,10 +2017,13 @@ int expand_downwards(struct vm_area_struct *vma, unsigned long address) - /* Enforce stack_guard_gap */ - prev = mas_prev(&mas, 0); - /* Check that both stack segments have the same anon_vma? */ -- if (prev && !(prev->vm_flags & VM_GROWSDOWN) && -- vma_is_accessible(prev)) { -- if (address - prev->vm_end < stack_guard_gap) -+ if (prev) { -+ if (!(prev->vm_flags & VM_GROWSDOWN) && -+ vma_is_accessible(prev) && -+ (address - prev->vm_end < stack_guard_gap)) - return -ENOMEM; -+ if (!write_locked && (prev->vm_end == address)) -+ return -EAGAIN; - } - - if (mas_preallocate(&mas, vma, GFP_KERNEL)) -@@ -2094,13 +2101,14 @@ static int __init cmdline_parse_stack_guard_gap(char *p) - __setup("stack_guard_gap=", cmdline_parse_stack_guard_gap); - - #ifdef CONFIG_STACK_GROWSUP --int expand_stack(struct vm_area_struct *vma, unsigned long address) -+int expand_stack_locked(struct vm_area_struct *vma, unsigned long address, -+ bool write_locked) - { -- return expand_upwards(vma, address); -+ return expand_upwards(vma, address, write_locked); - } - --struct vm_area_struct * --find_extend_vma(struct mm_struct *mm, unsigned long addr) -+struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, -+ unsigned long addr, bool write_locked) - { - struct vm_area_struct *vma, *prev; - -@@ -2108,20 +2116,25 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr) - vma = find_vma_prev(mm, addr, &prev); - if (vma && (vma->vm_start <= addr)) - return vma; -- if (!prev || expand_stack(prev, addr)) -+ if (!prev) -+ return NULL; -+ if (expand_stack_locked(prev, addr, write_locked)) - return NULL; - if (prev->vm_flags & VM_LOCKED) - populate_vma_page_range(prev, addr, prev->vm_end, NULL); - return prev; - } - #else --int expand_stack(struct vm_area_struct *vma, unsigned long address) -+int expand_stack_locked(struct vm_area_struct *vma, unsigned long address, -+ bool write_locked) - { -- return expand_downwards(vma, address); -+ if (unlikely(!(vma->vm_flags & VM_GROWSDOWN))) -+ return -EINVAL; -+ return expand_downwards(vma, address, write_locked); - } - --struct vm_area_struct * --find_extend_vma(struct mm_struct *mm, unsigned long addr) -+struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, -+ unsigned long addr, bool write_locked) - { - struct vm_area_struct *vma; - unsigned long start; -@@ -2132,10 +2145,8 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr) - return NULL; - if (vma->vm_start <= addr) - return vma; -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- return NULL; - start = vma->vm_start; -- if (expand_stack(vma, addr)) -+ if (expand_stack_locked(vma, addr, write_locked)) - return NULL; - if (vma->vm_flags & VM_LOCKED) - populate_vma_page_range(vma, addr, start, NULL); -@@ -2143,6 +2154,11 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr) - } - #endif - -+struct vm_area_struct *find_extend_vma(struct mm_struct *mm, -+ unsigned long addr) -+{ -+ return find_extend_vma_locked(mm, addr, false); -+} - EXPORT_SYMBOL_GPL(find_extend_vma); - - /* -diff --git a/mm/nommu.c b/mm/nommu.c -index 5b83938ecb67..2772d6b332ff 100644 ---- a/mm/nommu.c -+++ b/mm/nommu.c -@@ -694,7 +694,8 @@ struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr) - * expand a stack to a given address - * - not supported under NOMMU conditions - */ --int expand_stack(struct vm_area_struct *vma, unsigned long address) -+int expand_stack_locked(struct vm_area_struct *vma, unsigned long address, -+ bool write_locked) - { - return -ENOMEM; - } --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0007-execve-expand-new-process-stack-manually-ahead-of-ti.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0007-execve-expand-new-process-stack-manually-ahead-of-ti.patch deleted file mode 100644 index 3d14486670..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0007-execve-expand-new-process-stack-manually-ahead-of-ti.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 6175d1b3c0a36fb0756133647045e9a947fb183e Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Mon, 19 Jun 2023 11:34:15 -0700 -Subject: [PATCH 07/12] execve: expand new process stack manually ahead of time - -commit f313c51d26aa87e69633c9b46efb37a930faca71 upstream. - -This is a small step towards a model where GUP itself would not expand -the stack, and any user that needs GUP to not look up existing mappings, -but actually expand on them, would have to do so manually before-hand, -and with the mm lock held for writing. - -It turns out that execve() already did almost exactly that, except it -didn't take the mm lock at all (it's single-threaded so no locking -technically needed, but it could cause lockdep errors). And it only did -it for the CONFIG_STACK_GROWSUP case, since in that case GUP has -obviously never expanded the stack downwards. - -So just make that CONFIG_STACK_GROWSUP case do the right thing with -locking, and enable it generally. This will eventually help GUP, and in -the meantime avoids a special case and the lockdep issue. - -Signed-off-by: Linus Torvalds -[6.1 Minor context from still having FOLL_FORCE flags set] -Signed-off-by: Samuel Mendoza-Jonas -Signed-off-by: David Woodhouse -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - fs/exec.c | 37 +++++++++++++++++++++---------------- - 1 file changed, 21 insertions(+), 16 deletions(-) - -diff --git a/fs/exec.c b/fs/exec.c -index b192cb1d4364..b521aef3ddad 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -199,34 +199,39 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, - int write) - { - struct page *page; -+ struct vm_area_struct *vma = bprm->vma; -+ struct mm_struct *mm = bprm->mm; - int ret; -- unsigned int gup_flags = FOLL_FORCE; - --#ifdef CONFIG_STACK_GROWSUP -- if (write) { -- /* We claim to hold the lock - nobody to race with */ -- ret = expand_downwards(bprm->vma, pos, true); -- if (ret < 0) -+ /* -+ * Avoid relying on expanding the stack down in GUP (which -+ * does not work for STACK_GROWSUP anyway), and just do it -+ * by hand ahead of time. -+ */ -+ if (write && pos < vma->vm_start) { -+ mmap_write_lock(mm); -+ ret = expand_downwards(vma, pos, true); -+ if (unlikely(ret < 0)) { -+ mmap_write_unlock(mm); - return NULL; -- } --#endif -- -- if (write) -- gup_flags |= FOLL_WRITE; -+ } -+ mmap_write_downgrade(mm); -+ } else -+ mmap_read_lock(mm); - - /* - * We are doing an exec(). 'current' is the process -- * doing the exec and bprm->mm is the new process's mm. -+ * doing the exec and 'mm' is the new process's mm. - */ -- mmap_read_lock(bprm->mm); -- ret = get_user_pages_remote(bprm->mm, pos, 1, gup_flags, -+ ret = get_user_pages_remote(mm, pos, 1, -+ write ? FOLL_WRITE : 0, - &page, NULL, NULL); -- mmap_read_unlock(bprm->mm); -+ mmap_read_unlock(mm); - if (ret <= 0) - return NULL; - - if (write) -- acct_arg_size(bprm, vma_pages(bprm->vma)); -+ acct_arg_size(bprm, vma_pages(vma)); - - return page; - } --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0008-mm-always-expand-the-stack-with-the-mmap-write-lock-.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0008-mm-always-expand-the-stack-with-the-mmap-write-lock-.patch deleted file mode 100644 index 0a2033560f..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0008-mm-always-expand-the-stack-with-the-mmap-write-lock-.patch +++ /dev/null @@ -1,711 +0,0 @@ -From c6a63569c52d6cfeb26208f0715b1c77848c20f2 Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Sat, 24 Jun 2023 13:45:51 -0700 -Subject: [PATCH 08/12] mm: always expand the stack with the mmap write lock - held - -commit 8d7071af890768438c14db6172cc8f9f4d04e184 upstream - -This finishes the job of always holding the mmap write lock when -extending the user stack vma, and removes the 'write_locked' argument -from the vm helper functions again. - -For some cases, we just avoid expanding the stack at all: drivers and -page pinning really shouldn't be extending any stacks. Let's see if any -strange users really wanted that. - -It's worth noting that architectures that weren't converted to the new -lock_mm_and_find_vma() helper function are left using the legacy -"expand_stack()" function, but it has been changed to drop the mmap_lock -and take it for writing while expanding the vma. This makes it fairly -straightforward to convert the remaining architectures. - -As a result of dropping and re-taking the lock, the calling conventions -for this function have also changed, since the old vma may no longer be -valid. So it will now return the new vma if successful, and NULL - and -the lock dropped - if the area could not be extended. - -Signed-off-by: Linus Torvalds -[6.1: Patch drivers/iommu/io-pgfault.c instead] -Signed-off-by: Samuel Mendoza-Jonas -Signed-off-by: David Woodhouse -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - arch/ia64/mm/fault.c | 36 ++--------- - arch/m68k/mm/fault.c | 9 ++- - arch/microblaze/mm/fault.c | 5 +- - arch/openrisc/mm/fault.c | 5 +- - arch/parisc/mm/fault.c | 23 ++++--- - arch/s390/mm/fault.c | 5 +- - arch/sparc/mm/fault_64.c | 8 ++- - arch/um/kernel/trap.c | 11 ++-- - drivers/iommu/amd/iommu_v2.c | 4 +- - drivers/iommu/io-pgfault.c | 2 +- - fs/binfmt_elf.c | 2 +- - fs/exec.c | 4 +- - include/linux/mm.h | 16 ++--- - mm/gup.c | 6 +- - mm/memory.c | 10 ++- - mm/mmap.c | 121 ++++++++++++++++++++++++++++------- - mm/nommu.c | 18 ++---- - 17 files changed, 169 insertions(+), 116 deletions(-) - -diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c -index ef78c2d66cdd..99a09abe1d2c 100644 ---- a/arch/ia64/mm/fault.c -+++ b/arch/ia64/mm/fault.c -@@ -110,10 +110,12 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re - * register backing store that needs to expand upwards, in - * this case vma will be null, but prev_vma will ne non-null - */ -- if (( !vma && prev_vma ) || (address < vma->vm_start) ) -- goto check_expansion; -+ if (( !vma && prev_vma ) || (address < vma->vm_start) ) { -+ vma = expand_stack(mm, address); -+ if (!vma) -+ goto bad_area_nosemaphore; -+ } - -- good_area: - code = SEGV_ACCERR; - - /* OK, we've got a good vm_area for this memory area. Check the access permissions: */ -@@ -174,35 +176,9 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re - mmap_read_unlock(mm); - return; - -- check_expansion: -- if (!(prev_vma && (prev_vma->vm_flags & VM_GROWSUP) && (address == prev_vma->vm_end))) { -- if (!vma) -- goto bad_area; -- if (!(vma->vm_flags & VM_GROWSDOWN)) -- goto bad_area; -- if (REGION_NUMBER(address) != REGION_NUMBER(vma->vm_start) -- || REGION_OFFSET(address) >= RGN_MAP_LIMIT) -- goto bad_area; -- if (expand_stack(vma, address)) -- goto bad_area; -- } else { -- vma = prev_vma; -- if (REGION_NUMBER(address) != REGION_NUMBER(vma->vm_start) -- || REGION_OFFSET(address) >= RGN_MAP_LIMIT) -- goto bad_area; -- /* -- * Since the register backing store is accessed sequentially, -- * we disallow growing it by more than a page at a time. -- */ -- if (address > vma->vm_end + PAGE_SIZE - sizeof(long)) -- goto bad_area; -- if (expand_upwards(vma, address)) -- goto bad_area; -- } -- goto good_area; -- - bad_area: - mmap_read_unlock(mm); -+ bad_area_nosemaphore: - if ((isr & IA64_ISR_SP) - || ((isr & IA64_ISR_NA) && (isr & IA64_ISR_CODE_MASK) == IA64_ISR_CODE_LFETCH)) - { -diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c -index 4d2837eb3e2a..6f62af8e293a 100644 ---- a/arch/m68k/mm/fault.c -+++ b/arch/m68k/mm/fault.c -@@ -105,8 +105,9 @@ int do_page_fault(struct pt_regs *regs, unsigned long address, - if (address + 256 < rdusp()) - goto map_err; - } -- if (expand_stack(vma, address)) -- goto map_err; -+ vma = expand_stack(mm, address); -+ if (!vma) -+ goto map_err_nosemaphore; - - /* - * Ok, we have a good vm_area for this memory access, so -@@ -193,10 +194,12 @@ int do_page_fault(struct pt_regs *regs, unsigned long address, - goto send_sig; - - map_err: -+ mmap_read_unlock(mm); -+map_err_nosemaphore: - current->thread.signo = SIGSEGV; - current->thread.code = SEGV_MAPERR; - current->thread.faddr = address; -- goto send_sig; -+ return send_fault_sig(regs); - - acc_err: - current->thread.signo = SIGSEGV; -diff --git a/arch/microblaze/mm/fault.c b/arch/microblaze/mm/fault.c -index 5c40c3ebe52f..a409bb3f09f7 100644 ---- a/arch/microblaze/mm/fault.c -+++ b/arch/microblaze/mm/fault.c -@@ -192,8 +192,9 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, - && (kernel_mode(regs) || !store_updates_sp(regs))) - goto bad_area; - } -- if (expand_stack(vma, address)) -- goto bad_area; -+ vma = expand_stack(mm, address); -+ if (!vma) -+ goto bad_area_nosemaphore; - - good_area: - code = SEGV_ACCERR; -diff --git a/arch/openrisc/mm/fault.c b/arch/openrisc/mm/fault.c -index b4762d66e9ef..e3ad46d02fbd 100644 ---- a/arch/openrisc/mm/fault.c -+++ b/arch/openrisc/mm/fault.c -@@ -127,8 +127,9 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long address, - if (address + PAGE_SIZE < regs->sp) - goto bad_area; - } -- if (expand_stack(vma, address)) -- goto bad_area; -+ vma = expand_stack(mm, address); -+ if (!vma) -+ goto bad_area_nosemaphore; - - /* - * Ok, we have a good vm_area for this memory access, so -diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c -index 869204e97ec9..1843b493910c 100644 ---- a/arch/parisc/mm/fault.c -+++ b/arch/parisc/mm/fault.c -@@ -288,15 +288,19 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, - retry: - mmap_read_lock(mm); - vma = find_vma_prev(mm, address, &prev_vma); -- if (!vma || address < vma->vm_start) -- goto check_expansion; -+ if (!vma || address < vma->vm_start) { -+ if (!prev || !(prev->vm_flags & VM_GROWSUP)) -+ goto bad_area; -+ vma = expand_stack(mm, address); -+ if (!vma) -+ goto bad_area_nosemaphore; -+ } -+ - /* - * Ok, we have a good vm_area for this memory access. We still need to - * check the access permissions. - */ - --good_area: -- - if ((vma->vm_flags & acc_type) != acc_type) - goto bad_area; - -@@ -342,17 +346,13 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, - mmap_read_unlock(mm); - return; - --check_expansion: -- vma = prev_vma; -- if (vma && (expand_stack(vma, address) == 0)) -- goto good_area; -- - /* - * Something tried to access memory that isn't in our memory map.. - */ - bad_area: - mmap_read_unlock(mm); - -+bad_area_nosemaphore: - if (user_mode(regs)) { - int signo, si_code; - -@@ -444,7 +444,7 @@ handle_nadtlb_fault(struct pt_regs *regs) - { - unsigned long insn = regs->iir; - int breg, treg, xreg, val = 0; -- struct vm_area_struct *vma, *prev_vma; -+ struct vm_area_struct *vma; - struct task_struct *tsk; - struct mm_struct *mm; - unsigned long address; -@@ -480,7 +480,7 @@ handle_nadtlb_fault(struct pt_regs *regs) - /* Search for VMA */ - address = regs->ior; - mmap_read_lock(mm); -- vma = find_vma_prev(mm, address, &prev_vma); -+ vma = vma_lookup(mm, address); - mmap_read_unlock(mm); - - /* -@@ -489,7 +489,6 @@ handle_nadtlb_fault(struct pt_regs *regs) - */ - acc_type = (insn & 0x40) ? VM_WRITE : VM_READ; - if (vma -- && address >= vma->vm_start - && (vma->vm_flags & acc_type) == acc_type) - val = 1; - } -diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c -index 8e84ed2bb944..2ab388179833 100644 ---- a/arch/s390/mm/fault.c -+++ b/arch/s390/mm/fault.c -@@ -429,8 +429,9 @@ static inline vm_fault_t do_exception(struct pt_regs *regs, int access) - if (unlikely(vma->vm_start > address)) { - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto out_up; -- if (expand_stack(vma, address)) -- goto out_up; -+ vma = expand_stack(mm, address); -+ if (!vma) -+ goto out; - } - - /* -diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c -index 4acc12eafbf5..df685a241855 100644 ---- a/arch/sparc/mm/fault_64.c -+++ b/arch/sparc/mm/fault_64.c -@@ -383,8 +383,9 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) - goto bad_area; - } - } -- if (expand_stack(vma, address)) -- goto bad_area; -+ vma = expand_stack(mm, address); -+ if (!vma) -+ goto bad_area_nosemaphore; - /* - * Ok, we have a good vm_area for this memory access, so - * we can handle it.. -@@ -482,8 +483,9 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) - * Fix it, but check if it's kernel or user first.. - */ - bad_area: -- insn = get_fault_insn(regs, insn); - mmap_read_unlock(mm); -+bad_area_nosemaphore: -+ insn = get_fault_insn(regs, insn); - - handle_kernel_fault: - do_kernel_fault(regs, si_code, fault_code, insn, address); -diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c -index d3ce21c4ca32..6d8ae86ae978 100644 ---- a/arch/um/kernel/trap.c -+++ b/arch/um/kernel/trap.c -@@ -47,14 +47,15 @@ int handle_page_fault(unsigned long address, unsigned long ip, - vma = find_vma(mm, address); - if (!vma) - goto out; -- else if (vma->vm_start <= address) -+ if (vma->vm_start <= address) - goto good_area; -- else if (!(vma->vm_flags & VM_GROWSDOWN)) -+ if (!(vma->vm_flags & VM_GROWSDOWN)) - goto out; -- else if (is_user && !ARCH_IS_STACKGROW(address)) -- goto out; -- else if (expand_stack(vma, address)) -+ if (is_user && !ARCH_IS_STACKGROW(address)) - goto out; -+ vma = expand_stack(mm, address); -+ if (!vma) -+ goto out_nosemaphore; - - good_area: - *code_out = SEGV_ACCERR; -diff --git a/drivers/iommu/amd/iommu_v2.c b/drivers/iommu/amd/iommu_v2.c -index 9f7fab49a5a9..75355ddca657 100644 ---- a/drivers/iommu/amd/iommu_v2.c -+++ b/drivers/iommu/amd/iommu_v2.c -@@ -485,8 +485,8 @@ static void do_fault(struct work_struct *work) - flags |= FAULT_FLAG_REMOTE; - - mmap_read_lock(mm); -- vma = find_extend_vma(mm, address); -- if (!vma || address < vma->vm_start) -+ vma = vma_lookup(mm, address); -+ if (!vma) - /* failed to get a vma in the right range */ - goto out; - -diff --git a/drivers/iommu/io-pgfault.c b/drivers/iommu/io-pgfault.c -index 1df8c1dcae77..16e564cb393b 100644 ---- a/drivers/iommu/io-pgfault.c -+++ b/drivers/iommu/io-pgfault.c -@@ -89,7 +89,7 @@ iopf_handle_single(struct iopf_fault *iopf) - - mmap_read_lock(mm); - -- vma = find_extend_vma(mm, prm->addr); -+ vma = vma_lookup(mm, prm->addr); - if (!vma) - /* Unmapped area */ - goto out_put_mm; -diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c -index 5688c3e6adc1..e6c9c0e08448 100644 ---- a/fs/binfmt_elf.c -+++ b/fs/binfmt_elf.c -@@ -317,7 +317,7 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, - */ - if (mmap_write_lock_killable(mm)) - return -EINTR; -- vma = find_extend_vma_locked(mm, bprm->p, true); -+ vma = find_extend_vma_locked(mm, bprm->p); - mmap_write_unlock(mm); - if (!vma) - return -EFAULT; -diff --git a/fs/exec.c b/fs/exec.c -index b521aef3ddad..7410e93242ee 100644 ---- a/fs/exec.c -+++ b/fs/exec.c -@@ -210,7 +210,7 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, - */ - if (write && pos < vma->vm_start) { - mmap_write_lock(mm); -- ret = expand_downwards(vma, pos, true); -+ ret = expand_downwards(vma, pos); - if (unlikely(ret < 0)) { - mmap_write_unlock(mm); - return NULL; -@@ -861,7 +861,7 @@ int setup_arg_pages(struct linux_binprm *bprm, - stack_base = vma->vm_start - stack_expand; - #endif - current->mm->start_stack = bprm->p; -- ret = expand_stack_locked(vma, stack_base, true); -+ ret = expand_stack_locked(vma, stack_base); - if (ret) - ret = -EFAULT; - -diff --git a/include/linux/mm.h b/include/linux/mm.h -index d4153b26607d..130fa3508b9e 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -2820,18 +2820,11 @@ extern vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf); - - extern unsigned long stack_guard_gap; - /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ --int expand_stack_locked(struct vm_area_struct *vma, unsigned long address, -- bool write_locked); --#define expand_stack(vma,addr) expand_stack_locked(vma,addr,false) -+int expand_stack_locked(struct vm_area_struct *vma, unsigned long address); -+struct vm_area_struct *expand_stack(struct mm_struct * mm, unsigned long addr); - - /* CONFIG_STACK_GROWSUP still needs to grow downwards at some places */ --int expand_downwards(struct vm_area_struct *vma, unsigned long address, -- bool write_locked); --#if VM_GROWSUP --extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); --#else -- #define expand_upwards(vma, address) (0) --#endif -+int expand_downwards(struct vm_area_struct *vma, unsigned long address); - - /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ - extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); -@@ -2926,9 +2919,8 @@ unsigned long change_prot_numa(struct vm_area_struct *vma, - unsigned long start, unsigned long end); - #endif - --struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); - struct vm_area_struct *find_extend_vma_locked(struct mm_struct *, -- unsigned long addr, bool write_locked); -+ unsigned long addr); - int remap_pfn_range(struct vm_area_struct *, unsigned long addr, - unsigned long pfn, unsigned long size, pgprot_t); - int remap_pfn_range_notrack(struct vm_area_struct *vma, unsigned long addr, -diff --git a/mm/gup.c b/mm/gup.c -index 028f3b4e8c3f..f4911ddd3070 100644 ---- a/mm/gup.c -+++ b/mm/gup.c -@@ -1182,7 +1182,7 @@ static long __get_user_pages(struct mm_struct *mm, - - /* first iteration or cross vma bound */ - if (!vma || start >= vma->vm_end) { -- vma = find_extend_vma(mm, start); -+ vma = vma_lookup(mm, start); - if (!vma && in_gate_area(mm, start)) { - ret = get_gate_page(mm, start & PAGE_MASK, - gup_flags, &vma, -@@ -1351,8 +1351,8 @@ int fixup_user_fault(struct mm_struct *mm, - fault_flags |= FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE; - - retry: -- vma = find_extend_vma(mm, address); -- if (!vma || address < vma->vm_start) -+ vma = vma_lookup(mm, address); -+ if (!vma) - return -EFAULT; - - if (!vma_permits_fault(vma, fault_flags)) -diff --git a/mm/memory.c b/mm/memory.c -index 72ee449be39b..e3899ca23fab 100644 ---- a/mm/memory.c -+++ b/mm/memory.c -@@ -5352,7 +5352,7 @@ struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm, - goto fail; - } - -- if (expand_stack_locked(vma, addr, true)) -+ if (expand_stack_locked(vma, addr)) - goto fail; - - success: -@@ -5636,6 +5636,14 @@ int __access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf, - if (mmap_read_lock_killable(mm)) - return 0; - -+ /* We might need to expand the stack to access it */ -+ vma = vma_lookup(mm, addr); -+ if (!vma) { -+ vma = expand_stack(mm, addr); -+ if (!vma) -+ return 0; -+ } -+ - /* ignore errors, just check how much was successfully transferred */ - while (len) { - int bytes, ret, offset; -diff --git a/mm/mmap.c b/mm/mmap.c -index 5b9419c5b5c4..4e823c15e0a7 100644 ---- a/mm/mmap.c -+++ b/mm/mmap.c -@@ -1907,8 +1907,7 @@ static int acct_stack_growth(struct vm_area_struct *vma, - * PA-RISC uses this for its stack; IA64 for its Register Backing Store. - * vma is the last one with address > vma->vm_end. Have to extend vma. - */ --int expand_upwards(struct vm_area_struct *vma, unsigned long address, -- bool write_locked) -+static int expand_upwards(struct vm_area_struct *vma, unsigned long address) - { - struct mm_struct *mm = vma->vm_mm; - struct vm_area_struct *next; -@@ -1932,8 +1931,6 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address, - if (gap_addr < address || gap_addr > TASK_SIZE) - gap_addr = TASK_SIZE; - -- if (!write_locked) -- return -EAGAIN; - next = find_vma_intersection(mm, vma->vm_end, gap_addr); - if (next && vma_is_accessible(next)) { - if (!(next->vm_flags & VM_GROWSUP)) -@@ -2001,15 +1998,18 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address, - - /* - * vma is the first one with address < vma->vm_start. Have to extend vma. -+ * mmap_lock held for writing. - */ --int expand_downwards(struct vm_area_struct *vma, unsigned long address, -- bool write_locked) -+int expand_downwards(struct vm_area_struct *vma, unsigned long address) - { - struct mm_struct *mm = vma->vm_mm; - MA_STATE(mas, &mm->mm_mt, vma->vm_start, vma->vm_start); - struct vm_area_struct *prev; - int error = 0; - -+ if (!(vma->vm_flags & VM_GROWSDOWN)) -+ return -EFAULT; -+ - address &= PAGE_MASK; - if (address < mmap_min_addr) - return -EPERM; -@@ -2022,8 +2022,6 @@ int expand_downwards(struct vm_area_struct *vma, unsigned long address, - vma_is_accessible(prev) && - (address - prev->vm_end < stack_guard_gap)) - return -ENOMEM; -- if (!write_locked && (prev->vm_end == address)) -- return -EAGAIN; - } - - if (mas_preallocate(&mas, vma, GFP_KERNEL)) -@@ -2101,14 +2099,12 @@ static int __init cmdline_parse_stack_guard_gap(char *p) - __setup("stack_guard_gap=", cmdline_parse_stack_guard_gap); - - #ifdef CONFIG_STACK_GROWSUP --int expand_stack_locked(struct vm_area_struct *vma, unsigned long address, -- bool write_locked) -+int expand_stack_locked(struct vm_area_struct *vma, unsigned long address) - { -- return expand_upwards(vma, address, write_locked); -+ return expand_upwards(vma, address); - } - --struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, -- unsigned long addr, bool write_locked) -+struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, unsigned long addr) - { - struct vm_area_struct *vma, *prev; - -@@ -2118,23 +2114,21 @@ struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, - return vma; - if (!prev) - return NULL; -- if (expand_stack_locked(prev, addr, write_locked)) -+ if (expand_stack_locked(prev, addr)) - return NULL; - if (prev->vm_flags & VM_LOCKED) - populate_vma_page_range(prev, addr, prev->vm_end, NULL); - return prev; - } - #else --int expand_stack_locked(struct vm_area_struct *vma, unsigned long address, -- bool write_locked) -+int expand_stack_locked(struct vm_area_struct *vma, unsigned long address) - { - if (unlikely(!(vma->vm_flags & VM_GROWSDOWN))) - return -EINVAL; -- return expand_downwards(vma, address, write_locked); -+ return expand_downwards(vma, address); - } - --struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, -- unsigned long addr, bool write_locked) -+struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, unsigned long addr) - { - struct vm_area_struct *vma; - unsigned long start; -@@ -2146,7 +2140,7 @@ struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, - if (vma->vm_start <= addr) - return vma; - start = vma->vm_start; -- if (expand_stack_locked(vma, addr, write_locked)) -+ if (expand_stack_locked(vma, addr)) - return NULL; - if (vma->vm_flags & VM_LOCKED) - populate_vma_page_range(vma, addr, start, NULL); -@@ -2154,12 +2148,91 @@ struct vm_area_struct *find_extend_vma_locked(struct mm_struct *mm, - } - #endif - --struct vm_area_struct *find_extend_vma(struct mm_struct *mm, -- unsigned long addr) -+/* -+ * IA64 has some horrid mapping rules: it can expand both up and down, -+ * but with various special rules. -+ * -+ * We'll get rid of this architecture eventually, so the ugliness is -+ * temporary. -+ */ -+#ifdef CONFIG_IA64 -+static inline bool vma_expand_ok(struct vm_area_struct *vma, unsigned long addr) -+{ -+ return REGION_NUMBER(addr) == REGION_NUMBER(vma->vm_start) && -+ REGION_OFFSET(addr) < RGN_MAP_LIMIT; -+} -+ -+/* -+ * IA64 stacks grow down, but there's a special register backing store -+ * that can grow up. Only sequentially, though, so the new address must -+ * match vm_end. -+ */ -+static inline int vma_expand_up(struct vm_area_struct *vma, unsigned long addr) -+{ -+ if (!vma_expand_ok(vma, addr)) -+ return -EFAULT; -+ if (vma->vm_end != (addr & PAGE_MASK)) -+ return -EFAULT; -+ return expand_upwards(vma, addr); -+} -+ -+static inline bool vma_expand_down(struct vm_area_struct *vma, unsigned long addr) -+{ -+ if (!vma_expand_ok(vma, addr)) -+ return -EFAULT; -+ return expand_downwards(vma, addr); -+} -+ -+#elif defined(CONFIG_STACK_GROWSUP) -+ -+#define vma_expand_up(vma,addr) expand_upwards(vma, addr) -+#define vma_expand_down(vma, addr) (-EFAULT) -+ -+#else -+ -+#define vma_expand_up(vma,addr) (-EFAULT) -+#define vma_expand_down(vma, addr) expand_downwards(vma, addr) -+ -+#endif -+ -+/* -+ * expand_stack(): legacy interface for page faulting. Don't use unless -+ * you have to. -+ * -+ * This is called with the mm locked for reading, drops the lock, takes -+ * the lock for writing, tries to look up a vma again, expands it if -+ * necessary, and downgrades the lock to reading again. -+ * -+ * If no vma is found or it can't be expanded, it returns NULL and has -+ * dropped the lock. -+ */ -+struct vm_area_struct *expand_stack(struct mm_struct *mm, unsigned long addr) - { -- return find_extend_vma_locked(mm, addr, false); -+ struct vm_area_struct *vma, *prev; -+ -+ mmap_read_unlock(mm); -+ if (mmap_write_lock_killable(mm)) -+ return NULL; -+ -+ vma = find_vma_prev(mm, addr, &prev); -+ if (vma && vma->vm_start <= addr) -+ goto success; -+ -+ if (prev && !vma_expand_up(prev, addr)) { -+ vma = prev; -+ goto success; -+ } -+ -+ if (vma && !vma_expand_down(vma, addr)) -+ goto success; -+ -+ mmap_write_unlock(mm); -+ return NULL; -+ -+success: -+ mmap_write_downgrade(mm); -+ return vma; - } --EXPORT_SYMBOL_GPL(find_extend_vma); - - /* - * Ok - we have the memory areas we should free on a maple tree so release them, -diff --git a/mm/nommu.c b/mm/nommu.c -index 2772d6b332ff..b44ed69c109a 100644 ---- a/mm/nommu.c -+++ b/mm/nommu.c -@@ -681,25 +681,21 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) - } - EXPORT_SYMBOL(find_vma); - --/* -- * find a VMA -- * - we don't extend stack VMAs under NOMMU conditions -- */ --struct vm_area_struct *find_extend_vma(struct mm_struct *mm, unsigned long addr) --{ -- return find_vma(mm, addr); --} -- - /* - * expand a stack to a given address - * - not supported under NOMMU conditions - */ --int expand_stack_locked(struct vm_area_struct *vma, unsigned long address, -- bool write_locked) -+int expand_stack_locked(struct vm_area_struct *vma, unsigned long addr) - { - return -ENOMEM; - } - -+struct vm_area_struct *expand_stack(struct mm_struct *mm, unsigned long addr) -+{ -+ mmap_read_unlock(mm); -+ return NULL; -+} -+ - /* - * look up the first VMA exactly that exactly matches addr - * - should be called with mm->mmap_lock at least held readlocked --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0009-sparc32-fix-lock_mm_and_find_vma-conversion.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0009-sparc32-fix-lock_mm_and_find_vma-conversion.patch deleted file mode 100644 index cd183dec77..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0009-sparc32-fix-lock_mm_and_find_vma-conversion.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 31704a2f6ced2c32038da5a9fe994809f5bd8599 Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Thu, 29 Jun 2023 20:41:24 -0700 -Subject: [PATCH 09/12] sparc32: fix lock_mm_and_find_vma() conversion - -commit 0b26eadbf200abf6c97c6d870286c73219cdac65 upstream. - -The sparc32 conversion to lock_mm_and_find_vma() in commit a050ba1e7422 -("mm/fault: convert remaining simple cases to lock_mm_and_find_vma()") -missed the fact that we didn't actually have a 'regs' pointer available -in the 'force_user_fault()' case. - -It's there in the regular page fault path ("do_sparc_fault()"), but not -the window underflow/overflow paths. - -Which is all fine - we can just pass in a NULL pointer. The register -state is only used to avoid deadlock with kernel faults, which is not -the case for any of these register window faults. - -Reported-by: Stephen Rothwell -Fixes: a050ba1e7422 ("mm/fault: convert remaining simple cases to lock_mm_and_find_vma()") -Signed-off-by: Linus Torvalds -Cc: Naresh Kamboju -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - arch/sparc/mm/fault_32.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c -index aef2aebe2379..56eb40d385a8 100644 ---- a/arch/sparc/mm/fault_32.c -+++ b/arch/sparc/mm/fault_32.c -@@ -309,7 +309,7 @@ static void force_user_fault(unsigned long address, int write) - - code = SEGV_MAPERR; - -- vma = lock_mm_and_find_vma(mm, address, regs); -+ vma = lock_mm_and_find_vma(mm, address, NULL); - if (!vma) - goto bad_area_nosemaphore; - code = SEGV_ACCERR; --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0010-parisc-fix-expand_stack-conversion.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0010-parisc-fix-expand_stack-conversion.patch deleted file mode 100644 index bba0f10df7..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0010-parisc-fix-expand_stack-conversion.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 22d5b726da3683e03aef10e86eb09664101010c3 Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Thu, 29 Jun 2023 23:04:57 -0700 -Subject: [PATCH 10/12] parisc: fix expand_stack() conversion - -commit ea3f8272876f2958463992f6736ab690fde7fa9c upstream. - -In commit 8d7071af8907 ("mm: always expand the stack with the mmap write -lock held") I tried to deal with the remaining odd page fault handling -cases. The oddest one is ia64, which has stacks that grow both up and -down. And because ia64 was _so_ odd, I asked people to verify the end -result. - -But a close second oddity is parisc, which is the only one that has a -main stack growing up (our "CONFIG_STACK_GROWSUP" config option). But -it looked obvious enough that I didn't worry about it. - -I should have worried a bit more. Not because it was particularly -complex, but because I just used the wrong variable name. - -The previous vma isn't called "prev", it's called "prev_vma". Blush. - -Fixes: 8d7071af8907 ("mm: always expand the stack with the mmap write lock held") -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - arch/parisc/mm/fault.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c -index 1843b493910c..b00aa98b582c 100644 ---- a/arch/parisc/mm/fault.c -+++ b/arch/parisc/mm/fault.c -@@ -289,7 +289,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, - mmap_read_lock(mm); - vma = find_vma_prev(mm, address, &prev_vma); - if (!vma || address < vma->vm_start) { -- if (!prev || !(prev->vm_flags & VM_GROWSUP)) -+ if (!prev_vma || !(prev_vma->vm_flags & VM_GROWSUP)) - goto bad_area; - vma = expand_stack(mm, address); - if (!vma) --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0011-csky-fix-up-lock_mm_and_find_vma-conversion.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0011-csky-fix-up-lock_mm_and_find_vma-conversion.patch deleted file mode 100644 index 3b19b99e64..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0011-csky-fix-up-lock_mm_and_find_vma-conversion.patch +++ /dev/null @@ -1,50 +0,0 @@ -From ae3f3d9276f25f8bf576bf5d6b11decab626e9e6 Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Thu, 29 Jun 2023 23:34:29 -0700 -Subject: [PATCH 11/12] csky: fix up lock_mm_and_find_vma() conversion - -commit e55e5df193d247a38a5e1ac65a5316a0adcc22fa upstream. - -As already mentioned in my merge message for the 'expand-stack' branch, -we have something like 24 different versions of the page fault path for -all our different architectures, all just _slightly_ different due to -various historical reasons (usually related to exactly when they -branched off the original i386 version, and the details of the other -architectures they had in their history). - -And a few of them had some silly mistake in the conversion. - -Most of the architectures call the faulting address 'address' in the -fault path. But not all. Some just call it 'addr'. And if you end up -doing a bit too much copy-and-paste, you end up with the wrong version -in the places that do it differently. - -In this case it was csky. - -Fixes: a050ba1e7422 ("mm/fault: convert remaining simple cases to lock_mm_and_find_vma()") -Reported-by: Guenter Roeck -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - arch/csky/mm/fault.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/csky/mm/fault.c b/arch/csky/mm/fault.c -index ae9781b7d92e..a885518ce1dd 100644 ---- a/arch/csky/mm/fault.c -+++ b/arch/csky/mm/fault.c -@@ -237,7 +237,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs) - if (is_write(regs)) - flags |= FAULT_FLAG_WRITE; - retry: -- vma = lock_mm_and_find_vma(mm, address, regs); -+ vma = lock_mm_and_find_vma(mm, addr, regs); - if (unlikely(!vma)) { - bad_area_nosemaphore(regs, mm, code, addr); - return; --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0012-xtensa-fix-NOMMU-build-with-lock_mm_and_find_vma-con.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0012-xtensa-fix-NOMMU-build-with-lock_mm_and_find_vma-con.patch deleted file mode 100644 index 6c7116d285..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4/0012-xtensa-fix-NOMMU-build-with-lock_mm_and_find_vma-con.patch +++ /dev/null @@ -1,98 +0,0 @@ -From 75027a5c50130540d4ac17d3628f89a773bc792b Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Fri, 30 Jun 2023 18:24:49 -0700 -Subject: [PATCH 12/12] xtensa: fix NOMMU build with lock_mm_and_find_vma() - conversion -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -commit d85a143b69abb4d7544227e26d12c4c7735ab27d upstream. - -It turns out that xtensa has a really odd configuration situation: you -can do a no-MMU config, but still have the page fault code enabled. -Which doesn't sound all that sensible, but it turns out that xtensa can -have protection faults even without the MMU, and we have this: - - config PFAULT - bool "Handle protection faults" if EXPERT && !MMU - default y - help - Handle protection faults. MMU configurations must enable it. - noMMU configurations may disable it if used memory map never - generates protection faults or faults are always fatal. - - If unsure, say Y. - -which completely violated my expectations of the page fault handling. - -End result: Guenter reports that the xtensa no-MMU builds all fail with - - arch/xtensa/mm/fault.c: In function ‘do_page_fault’: - arch/xtensa/mm/fault.c:133:8: error: implicit declaration of function ‘lock_mm_and_find_vma’ - -because I never exposed the new lock_mm_and_find_vma() function for the -no-MMU case. - -Doing so is simple enough, and fixes the problem. - -Reported-and-tested-by: Guenter Roeck -Fixes: a050ba1e7422 ("mm/fault: convert remaining simple cases to lock_mm_and_find_vma()") -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman - -Upstream-Status: Backport -CVE: CVE-2023-3269 ---- - include/linux/mm.h | 5 +++-- - mm/nommu.c | 11 +++++++++++ - 2 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/include/linux/mm.h b/include/linux/mm.h -index 130fa3508b9e..6b68eaca5b41 100644 ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -1931,6 +1931,9 @@ void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to); - void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end); - int generic_error_remove_page(struct address_space *mapping, struct page *page); - -+struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm, -+ unsigned long address, struct pt_regs *regs); -+ - #ifdef CONFIG_MMU - extern vm_fault_t handle_mm_fault(struct vm_area_struct *vma, - unsigned long address, unsigned int flags, -@@ -1942,8 +1945,6 @@ void unmap_mapping_pages(struct address_space *mapping, - pgoff_t start, pgoff_t nr, bool even_cows); - void unmap_mapping_range(struct address_space *mapping, - loff_t const holebegin, loff_t const holelen, int even_cows); --struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm, -- unsigned long address, struct pt_regs *regs); - #else - static inline vm_fault_t handle_mm_fault(struct vm_area_struct *vma, - unsigned long address, unsigned int flags, -diff --git a/mm/nommu.c b/mm/nommu.c -index b44ed69c109a..da26b3fec9eb 100644 ---- a/mm/nommu.c -+++ b/mm/nommu.c -@@ -681,6 +681,17 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) - } - EXPORT_SYMBOL(find_vma); - -+/* -+ * At least xtensa ends up having protection faults even with no -+ * MMU.. No stack expansion, at least. -+ */ -+struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm, -+ unsigned long addr, struct pt_regs *regs) -+{ -+ mmap_read_lock(mm); -+ return vma_lookup(mm, addr); -+} -+ - /* - * expand a stack to a given address - * - not supported under NOMMU conditions --- -2.34.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4_git.bb b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4_git.bb deleted file mode 100644 index 34212d6bb7..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx-xeno4_git.bb +++ /dev/null @@ -1,26 +0,0 @@ -include linux-lmp-fslc-imx_6.1.bb - -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" - -# Merge branch 'expand-stack': fixes use-after-frer-by-RCU vulnerability -SRC_URI += " \ - file://0001-mm-introduce-new-lock_mm_and_find_vma-page-fault-hel.patch \ - file://0002-mm-make-the-page-fault-mmap-locking-killable.patch \ - file://0003-arm64-mm-Convert-to-using-lock_mm_and_find_vma.patch \ - file://0004-mm-fault-convert-remaining-simple-cases-to-lock_mm_a.patch \ - file://0005-powerpc-mm-convert-coprocessor-fault-to-lock_mm_and_.patch \ - file://0006-mm-make-find_extend_vma-fail-if-write-lock-not-held.patch \ - file://0007-execve-expand-new-process-stack-manually-ahead-of-ti.patch \ - file://0008-mm-always-expand-the-stack-with-the-mmap-write-lock-.patch \ - file://0009-sparc32-fix-lock_mm_and_find_vma-conversion.patch \ - file://0010-parisc-fix-expand_stack-conversion.patch \ - file://0011-csky-fix-up-lock_mm_and_find_vma-conversion.patch \ - file://0012-xtensa-fix-NOMMU-build-with-lock_mm_and_find_vma-con.patch \ -" - -KERNEL_REPO = "git://github.com/foundriesio/linux.git" -LINUX_VERSION = "6.1.24" -KERNEL_BRANCH = "6.1-1.0.x-imx-xeno4" - -SRCREV_machine = "25aa4b67c7364c4e628b0ce2e12429b287937b76" -LINUX_KERNEL_TYPE = "xeno4" diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-FIO-extras-arm64-dts-imx8mm-evk-use-imx8mm-evkb-for-.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-FIO-extras-arm64-dts-imx8mm-evk-use-imx8mm-evkb-for-.patch deleted file mode 100644 index 1820cf1283..0000000000 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-FIO-extras-arm64-dts-imx8mm-evk-use-imx8mm-evkb-for-.patch +++ /dev/null @@ -1,628 +0,0 @@ -From 39390475a682706cc0a095f2099ffcc385108e6e Mon Sep 17 00:00:00 2001 -From: Ricardo Salveti -Date: Fri, 14 May 2021 13:36:10 -0300 -Subject: [PATCH] [FIO extras] arm64: dts: imx8mm-evk: use imx8mm-evkb for the - new EVKs - -Allow older EVKs to be transitioned properly by using a new dtb for the -EVKB variant. - -Main difference is the pmic used (bd71847 -> pca9450). - -Upstream-Status: Inappropriate [configuration] - -Signed-off-by: Ricardo Salveti -Signed-off-by: Oleksandr Suvorov ---- - .../dts/freescale/imx8mm-evk-8mic-revE.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-ak4497.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-ak5558.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-dpdk.dts | 2 +- - .../dts/freescale/imx8mm-evk-ecspi-slave.dts | 2 +- - .../imx8mm-evk-hifiberry-dacplus.dts | 2 +- - .../freescale/imx8mm-evk-iqaudio-dacplus.dts | 2 +- - .../freescale/imx8mm-evk-iqaudio-dacpro.dts | 69 +++++++- - .../boot/dts/freescale/imx8mm-evk-lk.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-pcie-ep.dts | 2 +- - .../dts/freescale/imx8mm-evk-qca-wifi.dts | 3 +- - .../boot/dts/freescale/imx8mm-evk-rm67191.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-root.dts | 2 +- - .../boot/dts/freescale/imx8mm-evk-rpmsg.dts | 2 +- - .../dts/freescale/imx8mm-evk-usd-wifi.dts | 2 +- - arch/arm64/boot/dts/freescale/imx8mm-evk.dts | 147 +---------------- - arch/arm64/boot/dts/freescale/imx8mm-evkb.dts | 153 ++++++++++++++++++ - 17 files changed, 237 insertions(+), 161 deletions(-) - mode change 100755 => 100644 arch/arm64/boot/dts/freescale/imx8mm-evk-qca-wifi.dts - mode change 100755 => 100644 arch/arm64/boot/dts/freescale/imx8mm-evk.dts - create mode 100644 arch/arm64/boot/dts/freescale/imx8mm-evkb.dts - -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-8mic-revE.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-8mic-revE.dts -index 5facaecc733f09..36d70369af083b 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-8mic-revE.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-8mic-revE.dts -@@ -3,7 +3,7 @@ - * Copyright 2020 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - mic_leds { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts -index ca8e5d7b35d84f..4cf5b10b55a6e6 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-ak4497.dts -@@ -3,7 +3,7 @@ - * Copyright 2019 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - sound-ak4458 { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-ak5558.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-ak5558.dts -index 4d3da8e33688c3..149b5cf67ce76d 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-ak5558.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-ak5558.dts -@@ -4,7 +4,7 @@ - */ - - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - sound-ak5558 { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-dpdk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-dpdk.dts -index e600a7208c1ff4..08a4c3232ccf2e 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-dpdk.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-dpdk.dts -@@ -3,7 +3,7 @@ - * Copyright 2021 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - ðphy0 { - /delete-property/ reset-assert-us; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-ecspi-slave.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-ecspi-slave.dts -index e06dbc00d9dc78..b0670f2cde372b 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-ecspi-slave.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-ecspi-slave.dts -@@ -2,7 +2,7 @@ - // - // Copyright 2020 NXP - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - /delete-node/&spidev0; - -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-hifiberry-dacplus.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-hifiberry-dacplus.dts -index 9115dd67eb7054..47273b11ec6c9e 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-hifiberry-dacplus.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-hifiberry-dacplus.dts -@@ -3,7 +3,7 @@ - * Copyright 2020 NXP. - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - ext_osc_22m: ext-osc-22m { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacplus.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacplus.dts -index 3a1ccd204a5ad6..e5df1348c8e3ad 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacplus.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacplus.dts -@@ -3,7 +3,7 @@ - * Copyright 2020 NXP. - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - reg_3v3_vext: regulator-3v3-vext { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacpro.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacpro.dts -index ce99f4338cd2d7..85b3ec59fef306 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacpro.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-iqaudio-dacpro.dts -@@ -3,10 +3,77 @@ - * Copyright 2020 NXP. - */ - --#include "imx8mm-evk-iqaudio-dacplus.dts" -+#include "imx8mm-evkb.dts" -+ -+/ { -+ reg_3v3_vext: regulator-3v3-vext { -+ compatible = "regulator-fixed"; -+ regulator-name = "3V3_VEXT"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ }; -+ -+ sound-ak4458 { -+ status = "disabled"; -+ }; -+ -+ sound-micfil { -+ status = "disabled"; -+ }; -+ -+ sound-pcm512x { -+ compatible = "fsl,imx-audio-pcm512x"; -+ model = "pcm512x-audio"; -+ audio-cpu = <&sai5>; -+ audio-codec = <&pcm512x>; -+ format = "i2s"; -+ audio-widgets = -+ "Line", "Left Line Out Jack", -+ "Line", "Right Line Out Jack"; -+ audio-routing = -+ "Left Line Out Jack", "OUTL", -+ "Right Line Out Jack", "OUTR"; -+ dac,24db_digital_gain; -+ }; -+}; - - &i2c3 { -+ ak4458_1: ak4458@10 { -+ status = "disabled"; -+ }; -+ -+ ak4458_2: ak4458@12 { -+ status = "disabled"; -+ }; -+ -+ ak4497: ak4497@11 { -+ status = "disabled"; -+ }; -+ - pcm512x: pcm512x@4c { - compatible = "ti,pcm5142"; -+ reg = <0x4c>; -+ AVDD-supply = <®_3v3_vext>; -+ DVDD-supply = <®_3v3_vext>; -+ CPVDD-supply = <®_3v3_vext>; - }; - }; -+ -+&iomuxc { -+ pinctrl_sai5: sai5grp { -+ fsl,pins = < -+ MX8MM_IOMUXC_SAI5_RXD1_SAI5_TX_SYNC 0xd6 -+ MX8MM_IOMUXC_SAI5_RXD2_SAI5_TX_BCLK 0xd6 -+ MX8MM_IOMUXC_SAI5_RXD3_SAI5_TX_DATA0 0xd6 -+ MX8MM_IOMUXC_SAI5_RXD0_SAI5_RX_DATA0 0xd6 -+ >; -+ }; -+}; -+ -+&micfil { -+ status = "disabled"; -+}; -+ -+&sai5 { -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-lk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-lk.dts -index ccf3e9901e323c..16e32e7f1aed06 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-lk.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-lk.dts -@@ -3,7 +3,7 @@ - * Copyright 2019-2021 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - interrupt-parent = <&gic>; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-pcie-ep.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-pcie-ep.dts -index 2f96420e3230ef..61202cae7f3b89 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-pcie-ep.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-pcie-ep.dts -@@ -5,7 +5,7 @@ - - /dts-v1/; - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - &pcie0{ - status = "disabled"; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-qca-wifi.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-qca-wifi.dts -old mode 100755 -new mode 100644 -index aa1a25f00f5508..b5cbd103880d50 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-qca-wifi.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-qca-wifi.dts -@@ -5,10 +5,11 @@ - - /dts-v1/; - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - model = "FSL i.MX8MM LPDDR4 EVK with QCA WIFI revC board "; -+ compatible = "fsl,imx8mm-evk", "fsl,imx8mm"; - }; - - /delete-node/&pmic_nxp; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-rm67191.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-rm67191.dts -index 958912c409b2c7..d6563b7a41dadd 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-rm67191.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-rm67191.dts -@@ -3,7 +3,7 @@ - * Copyright 2019,2021 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - &adv_bridge { - status = "disabled"; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-root.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-root.dts -index 426b0adc31ce61..3986daaec096f0 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-root.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-root.dts -@@ -3,7 +3,7 @@ - * Copyright 2019 NXP - */ - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - interrupt-parent = <&gic>; -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-rpmsg.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-rpmsg.dts -index 2a477c74b6343c..46e817739e9fe9 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-rpmsg.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-rpmsg.dts -@@ -5,7 +5,7 @@ - - /dts-v1/; - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - / { - reserved-memory { -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk-usd-wifi.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk-usd-wifi.dts -index 9bf4ce755d5c15..c9c792ca4c3d40 100644 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk-usd-wifi.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk-usd-wifi.dts -@@ -5,7 +5,7 @@ - - /dts-v1/; - --#include "imx8mm-evk.dts" -+#include "imx8mm-evkb.dts" - - &pinctrl_usdhc2 { - fsl,pins = < -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts -old mode 100755 -new mode 100644 -index 932bb7cc3bb981..3156cb0d49ed40 ---- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts -@@ -5,149 +5,4 @@ - - /dts-v1/; - --#include --#include "imx8mm-evk.dtsi" -- --/ { -- model = "FSL i.MX8MM EVK board"; -- compatible = "fsl,imx8mm-evk", "fsl,imx8mm"; -- -- aliases { -- spi0 = &flexspi; -- }; -- -- reg_usdhc1_vmmc: regulator-usdhc1 { -- compatible = "regulator-fixed"; -- regulator-name = "WLAN_EN"; -- pinctrl-names = "default"; -- pinctrl-0 = <&pinctrl_reg_usdhc1_vmmc>; -- regulator-min-microvolt = <3300000>; -- regulator-max-microvolt = <3300000>; -- gpio = <&gpio2 10 GPIO_ACTIVE_HIGH>; -- enable-active-high; -- }; --}; -- --&flexspi { -- pinctrl-names = "default"; -- pinctrl-0 = <&pinctrl_flexspi>; -- status = "okay"; -- -- flash@0 { -- reg = <0>; -- #address-cells = <1>; -- #size-cells = <1>; -- compatible = "jedec,spi-nor"; -- spi-max-frequency = <80000000>; -- spi-tx-bus-width = <1>; -- spi-rx-bus-width = <4>; -- }; --}; -- --&usdhc1 { -- pinctrl-names = "default", "state_100mhz", "state_200mhz"; -- pinctrl-0 = <&pinctrl_usdhc1>, <&pinctrl_wlan>; -- pinctrl-1 = <&pinctrl_usdhc1_100mhz>, <&pinctrl_wlan>; -- pinctrl-2 = <&pinctrl_usdhc1_200mhz>, <&pinctrl_wlan>; -- bus-width = <4>; -- keep-power-in-suspend; -- non-removable; -- wakeup-source; -- vmmc-supply = <®_usdhc1_vmmc>; -- fsl,sdio-async-interrupt-enabled; -- status = "okay"; -- -- wifi_wake_host { -- compatible = "nxp,wifi-wake-host"; -- interrupt-parent = <&gpio2>; -- interrupts = <9 IRQ_TYPE_LEVEL_LOW>; -- interrupt-names = "host-wake"; -- }; --}; -- --&usdhc3 { -- assigned-clocks = <&clk IMX8MM_CLK_USDHC3_ROOT>; -- assigned-clock-rates = <400000000>; -- pinctrl-names = "default", "state_100mhz", "state_200mhz"; -- pinctrl-0 = <&pinctrl_usdhc3>; -- pinctrl-1 = <&pinctrl_usdhc3_100mhz>; -- pinctrl-2 = <&pinctrl_usdhc3_200mhz>; -- bus-width = <8>; -- non-removable; -- status = "okay"; --}; -- --&iomuxc { -- pinctrl_reg_usdhc1_vmmc: regusdhc1vmmcgrp { -- fsl,pins = < -- MX8MM_IOMUXC_SD1_RESET_B_GPIO2_IO10 0x141 -- >; -- }; -- -- pinctrl_flexspi: flexspigrp { -- fsl,pins = < -- MX8MM_IOMUXC_NAND_ALE_QSPI_A_SCLK 0x1c2 -- MX8MM_IOMUXC_NAND_CE0_B_QSPI_A_SS0_B 0x82 -- MX8MM_IOMUXC_NAND_DATA00_QSPI_A_DATA0 0x82 -- MX8MM_IOMUXC_NAND_DATA01_QSPI_A_DATA1 0x82 -- MX8MM_IOMUXC_NAND_DATA02_QSPI_A_DATA2 0x82 -- MX8MM_IOMUXC_NAND_DATA03_QSPI_A_DATA3 0x82 -- >; -- }; -- -- pinctrl_usdhc3: usdhc3grp { -- fsl,pins = < -- MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x190 -- MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d0 -- MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d0 -- MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d0 -- MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d0 -- MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d0 -- MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d0 -- MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d0 -- MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d0 -- MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d0 -- MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d0 -- MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x190 -- >; -- }; -- -- pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp { -- fsl,pins = < -- MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x194 -- MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d4 -- MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d4 -- MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d4 -- MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d4 -- MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d4 -- MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d4 -- MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d4 -- MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d4 -- MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d4 -- MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x194 -- >; -- }; -- -- pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp { -- fsl,pins = < -- MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x196 -- MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d6 -- MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d6 -- MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d6 -- MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d6 -- MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d6 -- MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d6 -- MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d6 -- MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d6 -- MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d6 -- MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x196 -- >; -- }; -- -- pinctrl_wlan: wlangrp { -- fsl,pins = < -- MX8MM_IOMUXC_GPIO1_IO00_ANAMIX_REF_CLK_32K 0x141 -- MX8MM_IOMUXC_SD1_DATA7_GPIO2_IO9 0x159 -- >; -- }; --}; -+#include "imx8mm-evk-qca-wifi.dts" -diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts b/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts -new file mode 100644 -index 00000000000000..932bb7cc3bb981 ---- /dev/null -+++ b/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts -@@ -0,0 +1,153 @@ -+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -+/* -+ * Copyright 2019-2020 NXP -+ */ -+ -+/dts-v1/; -+ -+#include -+#include "imx8mm-evk.dtsi" -+ -+/ { -+ model = "FSL i.MX8MM EVKB board"; -+ compatible = "fsl,imx8mm-evkb", "fsl,imx8mm-evk", "fsl,imx8mm"; -+ -+ aliases { -+ spi0 = &flexspi; -+ }; -+ -+ reg_usdhc1_vmmc: regulator-usdhc1 { -+ compatible = "regulator-fixed"; -+ regulator-name = "WLAN_EN"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_reg_usdhc1_vmmc>; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ gpio = <&gpio2 10 GPIO_ACTIVE_HIGH>; -+ enable-active-high; -+ }; -+}; -+ -+&flexspi { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pinctrl_flexspi>; -+ status = "okay"; -+ -+ flash@0 { -+ reg = <0>; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ compatible = "jedec,spi-nor"; -+ spi-max-frequency = <80000000>; -+ spi-tx-bus-width = <1>; -+ spi-rx-bus-width = <4>; -+ }; -+}; -+ -+&usdhc1 { -+ pinctrl-names = "default", "state_100mhz", "state_200mhz"; -+ pinctrl-0 = <&pinctrl_usdhc1>, <&pinctrl_wlan>; -+ pinctrl-1 = <&pinctrl_usdhc1_100mhz>, <&pinctrl_wlan>; -+ pinctrl-2 = <&pinctrl_usdhc1_200mhz>, <&pinctrl_wlan>; -+ bus-width = <4>; -+ keep-power-in-suspend; -+ non-removable; -+ wakeup-source; -+ vmmc-supply = <®_usdhc1_vmmc>; -+ fsl,sdio-async-interrupt-enabled; -+ status = "okay"; -+ -+ wifi_wake_host { -+ compatible = "nxp,wifi-wake-host"; -+ interrupt-parent = <&gpio2>; -+ interrupts = <9 IRQ_TYPE_LEVEL_LOW>; -+ interrupt-names = "host-wake"; -+ }; -+}; -+ -+&usdhc3 { -+ assigned-clocks = <&clk IMX8MM_CLK_USDHC3_ROOT>; -+ assigned-clock-rates = <400000000>; -+ pinctrl-names = "default", "state_100mhz", "state_200mhz"; -+ pinctrl-0 = <&pinctrl_usdhc3>; -+ pinctrl-1 = <&pinctrl_usdhc3_100mhz>; -+ pinctrl-2 = <&pinctrl_usdhc3_200mhz>; -+ bus-width = <8>; -+ non-removable; -+ status = "okay"; -+}; -+ -+&iomuxc { -+ pinctrl_reg_usdhc1_vmmc: regusdhc1vmmcgrp { -+ fsl,pins = < -+ MX8MM_IOMUXC_SD1_RESET_B_GPIO2_IO10 0x141 -+ >; -+ }; -+ -+ pinctrl_flexspi: flexspigrp { -+ fsl,pins = < -+ MX8MM_IOMUXC_NAND_ALE_QSPI_A_SCLK 0x1c2 -+ MX8MM_IOMUXC_NAND_CE0_B_QSPI_A_SS0_B 0x82 -+ MX8MM_IOMUXC_NAND_DATA00_QSPI_A_DATA0 0x82 -+ MX8MM_IOMUXC_NAND_DATA01_QSPI_A_DATA1 0x82 -+ MX8MM_IOMUXC_NAND_DATA02_QSPI_A_DATA2 0x82 -+ MX8MM_IOMUXC_NAND_DATA03_QSPI_A_DATA3 0x82 -+ >; -+ }; -+ -+ pinctrl_usdhc3: usdhc3grp { -+ fsl,pins = < -+ MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x190 -+ MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d0 -+ MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d0 -+ MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d0 -+ MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d0 -+ MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d0 -+ MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d0 -+ MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d0 -+ MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d0 -+ MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d0 -+ MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d0 -+ MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x190 -+ >; -+ }; -+ -+ pinctrl_usdhc3_100mhz: usdhc3-100mhzgrp { -+ fsl,pins = < -+ MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x194 -+ MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d4 -+ MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d4 -+ MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d4 -+ MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d4 -+ MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d4 -+ MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d4 -+ MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d4 -+ MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d4 -+ MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d4 -+ MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x194 -+ >; -+ }; -+ -+ pinctrl_usdhc3_200mhz: usdhc3-200mhzgrp { -+ fsl,pins = < -+ MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK 0x196 -+ MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD 0x1d6 -+ MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0 0x1d6 -+ MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1 0x1d6 -+ MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2 0x1d6 -+ MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3 0x1d6 -+ MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4 0x1d6 -+ MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5 0x1d6 -+ MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6 0x1d6 -+ MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7 0x1d6 -+ MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE 0x196 -+ >; -+ }; -+ -+ pinctrl_wlan: wlangrp { -+ fsl,pins = < -+ MX8MM_IOMUXC_GPIO1_IO00_ANAMIX_REF_CLK_32K 0x141 -+ MX8MM_IOMUXC_SD1_DATA7_GPIO2_IO9 0x159 -+ >; -+ }; -+}; --- -2.43.2 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-FIO-toimx-of-enable-using-OF_DYNAMIC-without-OF_UNIT.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-FIO-toimx-of-enable-using-OF_DYNAMIC-without-OF_UNIT.patch index 2ab3ff769e..7bd0303070 100644 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-FIO-toimx-of-enable-using-OF_DYNAMIC-without-OF_UNIT.patch +++ b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-FIO-toimx-of-enable-using-OF_DYNAMIC-without-OF_UNIT.patch @@ -1,4 +1,4 @@ -From c7ad24edca81bd463235ebe8399bac243bae177b Mon Sep 17 00:00:00 2001 +From 80f22266bcd157eeb1ce2b4a5725eeccfa1b4aa0 Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Tue, 30 May 2023 17:59:47 +0300 Subject: [PATCH 1/2] [FIO toimx] of: enable using OF_DYNAMIC without @@ -14,15 +14,14 @@ commit a553d46954894 ("MLK-17275-1 drm/bridge: adv7511: Add support for OF_DYNAM Upstream-Status: Pending Signed-off-by: Oleksandr Suvorov --- - drivers/of/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig -index 80b5fd44ab1c7..89204c537b06c 100644 +index da9826accb1b..d9ce37d6ddc6 100644 --- a/drivers/of/Kconfig +++ b/drivers/of/Kconfig -@@ -55,7 +55,7 @@ config OF_KOBJ +@@ -67,7 +67,7 @@ config OF_KOBJ # Hardly any platforms need this. It is safe to select, but only do so if you # need it. config OF_DYNAMIC @@ -31,6 +30,5 @@ index 80b5fd44ab1c7..89204c537b06c 100644 select OF_KOBJ help On some platforms, the device tree can be manipulated at runtime. --- -2.40.1 - +-- +2.25.1 diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-arm64-dts-imx8mq-drop-cpu-idle-states.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-arm64-dts-imx8mq-drop-cpu-idle-states.patch index c126c949bb..87016e4253 100644 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-arm64-dts-imx8mq-drop-cpu-idle-states.patch +++ b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-arm64-dts-imx8mq-drop-cpu-idle-states.patch @@ -1,4 +1,4 @@ -From 395e824b55ecbb9329771a107eb7d954bff93bc8 Mon Sep 17 00:00:00 2001 +From a136d319baca6a389010633ac77d47d538fc8ed2 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Wed, 13 Oct 2021 19:43:22 -0300 Subject: [PATCH 3/3] arm64: dts: imx8mq: drop cpu-idle-states @@ -11,47 +11,47 @@ a way to make the same dts compatible across multiple kernel versions. This allows the same 5.10-based device tree to be used for SystemReady. +Upstream-Status: Pending Signed-off-by: Ricardo Salveti --- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi -index 62ccb6eeff6a..7d748deb258c 100644 +index f67d31d6de65..a7b4b1dbc73c 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi -@@ -108,7 +108,6 @@ A53_0: cpu@0 { +@@ -130,7 +130,6 @@ A53_0: cpu@0 { #cooling-cells = <2>; nvmem-cells = <&cpu_speed_grade>; nvmem-cell-names = "speed_grade"; - cpu-idle-states = <&CPU_SLEEP>; }; - + A53_1: cpu@1 { -@@ -121,7 +120,6 @@ A53_1: cpu@1 { +@@ -149,7 +148,6 @@ A53_1: cpu@1 { next-level-cache = <&A53_L2>; operating-points-v2 = <&a53_opp_table>; #cooling-cells = <2>; - cpu-idle-states = <&CPU_SLEEP>; }; - + A53_2: cpu@2 { -@@ -134,7 +132,6 @@ A53_2: cpu@2 { +@@ -168,7 +166,6 @@ A53_2: cpu@2 { next-level-cache = <&A53_L2>; operating-points-v2 = <&a53_opp_table>; #cooling-cells = <2>; - cpu-idle-states = <&CPU_SLEEP>; }; - + A53_3: cpu@3 { -@@ -147,7 +144,6 @@ A53_3: cpu@3 { +@@ -187,7 +184,6 @@ A53_3: cpu@3 { next-level-cache = <&A53_L2>; operating-points-v2 = <&a53_opp_table>; #cooling-cells = <2>; - cpu-idle-states = <&CPU_SLEEP>; }; - + A53_L2: l2-cache0 { --- +-- 2.25.1 - diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-imx-dts-imx8mm-evkb-fix-the-pmic-name-to-avoid-dupli.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-imx-dts-imx8mm-evkb-fix-the-pmic-name-to-avoid-dupli.patch new file mode 100644 index 0000000000..af99f9f320 --- /dev/null +++ b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0001-imx-dts-imx8mm-evkb-fix-the-pmic-name-to-avoid-dupli.patch @@ -0,0 +1,46 @@ +From ed2cd372fc200ecb6acc9303fbfe31e5d29c0940 Mon Sep 17 00:00:00 2001 +From: Daiane Angolini +Date: Thu, 26 Dec 2024 22:24:23 +0000 +Subject: [PATCH] imx:dts:imx8mm-evkb: fix the pmic name to avoid duplicated + label error + +Since commit [1] changes the imx8mm-evk.dtsi node label and does not change the +imx8evkb.dts. + +Fix the error: +| DTC arch/arm64/boot/dts/freescale/imx8mm-evkb.dtb +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:28.21-35.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK1: Duplicate label 'buck1_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK1 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/BUCK1 +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:38.21-46.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK2: Duplicate label 'buck2_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK2 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/BUCK2 +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:49.21-55.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK3: Duplicate label 'buck3_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK3 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/BUCK3 +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:58.21-64.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK4: Duplicate label 'buck4_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK4 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/BUCK4 +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:67.21-73.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK5: Duplicate label 'buck5_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK5 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/BUCK5 +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:76.21-82.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK6: Duplicate label 'buck6_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/BUCK6 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/BUCK6 +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:85.19-91.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/LDO1: Duplicate label 'ldo1_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/LDO1 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/LDO1 +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:94.19-100.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/LDO2: Duplicate label 'ldo2_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/LDO2 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/LDO2 +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:103.19-109.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/LDO3: Duplicate label 'ldo3_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/LDO3 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/LDO3 +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:112.19-118.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/LDO4: Duplicate label 'ldo4_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/LDO4 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/LDO4 +.../imx8mm-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts:121.19-125.6: ERROR (duplicate_label): /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/LDO5: Duplicate label 'ldo5_reg' on /soc@0/bus@30800000/i2c@30a20000/pmic@25/regulators/LDO5 and /soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators/LDO5 + +[1] https://github.com/Freescale/linux-fslc/commit/a0d4da5937f3f0c2b8fed8c6bc4c003bea15a34c + +Upstream-status: Pending +Signed-off-by: Daiane Angolini +--- + arch/arm64/boot/dts/freescale/imx8mm-evkb.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts b/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts +index 164df627a213..fe9e19ed498b 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mm-evkb.dts +@@ -13,7 +13,7 @@ / { + }; + + &i2c1 { +- /delete-node/ pmic@4b; ++ /delete-node/ pca9450@25; + + pmic@25 { + compatible = "nxp,pca9450a"; +-- +2.44.1 diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0002-FIO-toup-media-Kconfig-fix-double-VIDEO_DEV.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0002-FIO-toup-media-Kconfig-fix-double-VIDEO_DEV.patch index 714444c9b2..3ed59631f5 100644 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0002-FIO-toup-media-Kconfig-fix-double-VIDEO_DEV.patch +++ b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0002-FIO-toup-media-Kconfig-fix-double-VIDEO_DEV.patch @@ -1,4 +1,4 @@ -From 5359b7f5ba75a3b93d4195d66290aa92c802cad4 Mon Sep 17 00:00:00 2001 +From c4369e16bf1e3e0f4bc1e04172986b5467f032d7 Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Tue, 30 May 2023 18:04:50 +0300 Subject: [PATCH 2/2] [FIO toup] media: Kconfig: fix double VIDEO_DEV @@ -11,12 +11,11 @@ Upstream-Status: Pending Fixes: commit 9958d30f38b96 ("media: Kconfig: cleanup VIDEO_DEV dependencies") Signed-off-by: Oleksandr Suvorov --- - drivers/staging/media/imx/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/media/imx/Kconfig b/drivers/staging/media/imx/Kconfig -index 58f3ebd53bfba..a154edad36333 100644 +index 4d67f6a01735..1d28658be856 100644 --- a/drivers/staging/media/imx/Kconfig +++ b/drivers/staging/media/imx/Kconfig @@ -4,7 +4,6 @@ config VIDEO_IMX_MEDIA @@ -24,9 +23,9 @@ index 58f3ebd53bfba..a154edad36333 100644 depends on HAS_DMA depends on VIDEO_DEV - depends on VIDEO_DEV + depends on IMX_IPUV3_CORE select MEDIA_CONTROLLER - select V4L2_FWNODE - select V4L2_MEM2MEM_DEV --- -2.40.1 - + select V4L2__MEM2MEM_DEV + select +-- +2.25.1 diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0003-FIO-toup-gpu-drm-cadence-select-hdmi-helper.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0003-FIO-toup-gpu-drm-cadence-select-hdmi-helper.patch index 5f0f287666..cd2465dc09 100644 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0003-FIO-toup-gpu-drm-cadence-select-hdmi-helper.patch +++ b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0003-FIO-toup-gpu-drm-cadence-select-hdmi-helper.patch @@ -1,4 +1,4 @@ -From 7edfba994d7eb53ad76d8de0cf8a92687e4f86e6 Mon Sep 17 00:00:00 2001 +From 245bf40e270a4175e254954336e5d28c0fe0aea7 Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Sat, 3 Jun 2023 20:11:26 +0300 Subject: [PATCH 3/4] [FIO toup] gpu: drm: cadence: select hdmi helper @@ -16,22 +16,20 @@ Upstream-Status: Pending Signed-off-by: Oleksandr Suvorov --- - drivers/gpu/drm/bridge/cadence/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/bridge/cadence/Kconfig b/drivers/gpu/drm/bridge/cadence/Kconfig -index 736b107fab74d..76dc4cb60ba58 100644 +index f5c5f049b7ca..7ebbe9ab09db 100644 --- a/drivers/gpu/drm/bridge/cadence/Kconfig +++ b/drivers/gpu/drm/bridge/cadence/Kconfig -@@ -40,6 +40,7 @@ config DRM_CDNS_MHDP +@@ -63,6 +63,7 @@ config DRM_CDNS_MHDP config DRM_CDNS_HDMI tristate "Cadence HDMI DRM driver" depends on DRM_CDNS_MHDP + select DRM_DISPLAY_HDMI_HELPER - + config DRM_CDNS_DP tristate "Cadence DP DRM driver" --- -2.40.1 - +-- +2.25.1 diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0004-FIO-toup-hwrng-optee-support-generic-crypto.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0004-FIO-toup-hwrng-optee-support-generic-crypto.patch index 93b7353a63..1ceba1d6eb 100644 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0004-FIO-toup-hwrng-optee-support-generic-crypto.patch +++ b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0004-FIO-toup-hwrng-optee-support-generic-crypto.patch @@ -1,8 +1,10 @@ -From 952f4b90ceee9deb3f266f17623e718272306105 Mon Sep 17 00:00:00 2001 +From b9c1cc917961ef85deb21903eb7019a1324edb54 Mon Sep 17 00:00:00 2001 From: Jorge Ramirez-Ortiz Date: Fri, 17 Jul 2020 09:09:37 +0200 Subject: [PATCH] hwrng: optee: support generic crypto +Upstream-Status: Pending + Signed-off-by: Jorge Ramirez-Ortiz Signed-off-by: Ricardo Salveti --- @@ -10,7 +12,7 @@ Signed-off-by: Ricardo Salveti 1 file changed, 2 insertions(+) diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c -index 135a82590923..bb21e025687f 100644 +index 96b5d546d136..23d0b55dea86 100644 --- a/drivers/char/hw_random/optee-rng.c +++ b/drivers/char/hw_random/optee-rng.c @@ -272,6 +272,8 @@ static int optee_rng_remove(struct device *dev) @@ -21,7 +23,6 @@ index 135a82590923..bb21e025687f 100644 + 0x94, 0x51, 0xc6, 0xfd, 0xff, 0x28, 0xad, 0x65)}, {} }; - --- -2.25.1 +-- +2.25.1 diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0004-FIO-toup-media-imx8-select-v4l2_-for-mxc-mipi-csi2_y.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0004-FIO-toup-media-imx8-select-v4l2_-for-mxc-mipi-csi2_y.patch index 1f0666c1d3..45ddee78fe 100644 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0004-FIO-toup-media-imx8-select-v4l2_-for-mxc-mipi-csi2_y.patch +++ b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/0004-FIO-toup-media-imx8-select-v4l2_-for-mxc-mipi-csi2_y.patch @@ -1,4 +1,4 @@ -From 75fd604dbdc332e02cd5d1c6bee60058ed0a509f Mon Sep 17 00:00:00 2001 +From 2535e0192a036d8ea502b2a31c47a103a591d26e Mon Sep 17 00:00:00 2001 From: Oleksandr Suvorov Date: Sat, 3 Jun 2023 20:25:35 +0300 Subject: [PATCH 4/4] [FIO toup] media: imx8: select v4l2_* for @@ -18,12 +18,11 @@ Upstream-Status: Pending Signed-off-by: Oleksandr Suvorov --- - drivers/media/platform/imx8/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/imx8/Kconfig b/drivers/media/platform/imx8/Kconfig -index eb42572ef27f3..d5ecd749e516b 100644 +index eb42572ef27f..d5ecd749e516 100644 --- a/drivers/media/platform/imx8/Kconfig +++ b/drivers/media/platform/imx8/Kconfig @@ -4,6 +4,7 @@ menu "IMX8 Camera ISI/MIPI Features support" @@ -31,9 +30,8 @@ index eb42572ef27f3..d5ecd749e516b 100644 tristate "IMX8 MIPI CSI2 Controller Yet Another Version" default y + select V4L2_FWNODE - + endmenu endif #VIDEO_MX8_CAPTURE --- -2.40.1 - +-- +2.25.1 diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/mx8mn-nxp-bsp/0001-FIO-internal-arm64-dts-imx8mn-evk.dtsi-re-add-blueto.patch b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/mx8mn-nxp-bsp/0001-FIO-internal-arm64-dts-imx8mn-evk.dtsi-re-add-blueto.patch index e4a5dc62d8..f6bd29d8b2 100644 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/mx8mn-nxp-bsp/0001-FIO-internal-arm64-dts-imx8mn-evk.dtsi-re-add-blueto.patch +++ b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/mx8mn-nxp-bsp/0001-FIO-internal-arm64-dts-imx8mn-evk.dtsi-re-add-blueto.patch @@ -8,15 +8,16 @@ This fixes the Murata 1MW bluetooth initialization Signed-off-by: Michael Scott Signed-off-by: Ricardo Salveti +Signed-off-by: Jose Quaresma --- arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi -index 6c2d66cdd2f4b..b0c09ca92ecc7 100644 +index 548d5695b59a..111b5b23e83b 100644 --- a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi -@@ -47,6 +47,14 @@ reg_usdhc2_vmmc: regulator-usdhc2 { +@@ -59,6 +59,14 @@ reg_usdhc2_vmmc: regulator-usdhc2 { enable-active-high; }; @@ -31,15 +32,15 @@ index 6c2d66cdd2f4b..b0c09ca92ecc7 100644 ir-receiver { compatible = "gpio-ir-receiver"; gpios = <&gpio1 13 GPIO_ACTIVE_LOW>; -@@ -476,6 +484,7 @@ &uart1 { /* BT */ +@@ -488,6 +496,7 @@ &uart1 { /* BT */ assigned-clocks = <&clk IMX8MN_CLK_UART1>; assigned-clock-parents = <&clk IMX8MN_SYS_PLL1_80M>; - fsl,uart-has-rtscts; + uart-has-rtscts; + resets = <&modem_reset>; status = "okay"; - }; -@@ -502,8 +511,10 @@ &usdhc1 { + bluetooth { +@@ -538,8 +547,10 @@ &usdhc1 { pinctrl-1 = <&pinctrl_usdhc1_100mhz>, <&pinctrl_wlan>; pinctrl-2 = <&pinctrl_usdhc1_200mhz>, <&pinctrl_wlan>; bus-width = <4>; @@ -48,9 +49,9 @@ index 6c2d66cdd2f4b..b0c09ca92ecc7 100644 non-removable; + cap-power-off-card; wakeup-source; - fsl,sdio-async-interrupt-enabled; - /delete-property/ vmmc-supply; -@@ -751,6 +762,7 @@ MX8MN_IOMUXC_UART1_RXD_UART1_DCE_RX 0x140 + vmmc-supply = <®_usdhc1_vmmc>; + status = "okay"; +@@ -773,6 +784,7 @@ MX8MN_IOMUXC_UART1_RXD_UART1_DCE_RX 0x140 MX8MN_IOMUXC_UART1_TXD_UART1_DCE_TX 0x140 MX8MN_IOMUXC_UART3_RXD_UART1_DCE_CTS_B 0x140 MX8MN_IOMUXC_UART3_TXD_UART1_DCE_RTS_B 0x140 @@ -59,5 +60,5 @@ index 6c2d66cdd2f4b..b0c09ca92ecc7 100644 }; -- -2.38.1 +2.47.1 diff --git a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx_6.1.bb b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx_6.6.bb similarity index 82% rename from meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx_6.1.bb rename to meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx_6.6.bb index 1b63b22e00..1da58f5d06 100644 --- a/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx_6.1.bb +++ b/meta-lmp-bsp/recipes-kernel/linux/linux-lmp-fslc-imx_6.6.bb @@ -5,22 +5,22 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" include recipes-kernel/linux/linux-lmp-fslc-imx.inc -include recipes-kernel/linux/kmeta-linux-lmp-6.1.y.inc +include recipes-kernel/linux/kmeta-linux-lmp-6.6.y.inc # Use Freescale kernel by default -LINUX_VERSION ?= "6.1.70" -KERNEL_BRANCH ?= "6.1-2.2.x-imx" +LINUX_VERSION ?= "6.6.54" +KERNEL_BRANCH ?= "6.6-2.1.x-imx" -SRCREV_machine = "1e6abd59ab9ff1cd4ea453383e72d12c120d193e" +SRCREV_machine = "6605f549a71ef3af9c65609cba985086ac4edf2b" SRC_URI += " \ file://0004-FIO-toup-hwrng-optee-support-generic-crypto.patch \ - file://0001-FIO-extras-arm64-dts-imx8mm-evk-use-imx8mm-evkb-for-.patch \ file://0001-arm64-dts-imx8mq-drop-cpu-idle-states.patch \ file://0001-FIO-toimx-of-enable-using-OF_DYNAMIC-without-OF_UNIT.patch \ file://0002-FIO-toup-media-Kconfig-fix-double-VIDEO_DEV.patch \ file://0003-FIO-toup-gpu-drm-cadence-select-hdmi-helper.patch \ file://0004-FIO-toup-media-imx8-select-v4l2_-for-mxc-mipi-csi2_y.patch \ + file://0001-imx-dts-imx8mm-evkb-fix-the-pmic-name-to-avoid-dupli.patch \ " SRC_URI:append:imx8mp-lpddr4-evk = " \