From 44ec302ce45a2cc04349a84bafc9a0b0ac579040 Mon Sep 17 00:00:00 2001 From: Emanuele Ghidoli Date: Mon, 4 Sep 2023 12:14:38 +0200 Subject: linux-toradex: update to toradex_5.15-2.2.x-imx Update the downstream kernel (NXP fork) to lf-5.15-2.2.0 plus fslc stable patches merges. Then rebase our 5.15-2.1.0 on top of it [1]. For the RT kernel, set the matching RT patch. [1] https://github.com/Freescale/linux-fslc/commit/7c13adcd3af7dcd541144655102e1cdb941ad538 Related-to: ELB-5185 Signed-off-by: Emanuele Ghidoli (cherry picked from commit 65db2ad74d40b30e4ea1421ce699cad62d08b0a8) --- recipes-kernel/linux/linux-imx-headers_5%.bbappend | 4 +- ...rt-ARM-9113-1-uaccess-remove-set_fs-imple.patch | 44 ------------------ ...-imx_sc_thermal-prevent-BUG-with-rt-patch.patch | 53 ---------------------- ...002-arch-arm-Kconfig-prepare-for-rt-patch.patch | 28 ------------ .../0002-ddr-perf-prevent-BUG-with-rt-patch.patch | 34 -------------- ...ert-arch-arm-Kconfig-prepare-for-rt-patch.patch | 28 ------------ ...rt-Revert-ARM-9113-1-uaccess-remove-set_f.patch | 42 ----------------- .../preempt-rt-less-latency.cfg | 14 ------ .../preempt-rt-less-latency.scc | 4 -- .../linux/linux-toradex-5.15-2.1.x/preempt-rt.cfg | 6 --- .../linux/linux-toradex-5.15-2.1.x/preempt-rt.scc | 4 -- ...rt-ARM-9113-1-uaccess-remove-set_fs-imple.patch | 44 ++++++++++++++++++ ...-imx_sc_thermal-prevent-BUG-with-rt-patch.patch | 53 ++++++++++++++++++++++ ...002-arch-arm-Kconfig-prepare-for-rt-patch.patch | 28 ++++++++++++ .../0002-ddr-perf-prevent-BUG-with-rt-patch.patch | 34 ++++++++++++++ ...ert-arch-arm-Kconfig-prepare-for-rt-patch.patch | 28 ++++++++++++ ...rt-Revert-ARM-9113-1-uaccess-remove-set_f.patch | 42 +++++++++++++++++ .../preempt-rt-less-latency.cfg | 14 ++++++ .../preempt-rt-less-latency.scc | 4 ++ .../linux/linux-toradex-5.15-2.2.x/preempt-rt.cfg | 6 +++ .../linux/linux-toradex-5.15-2.2.x/preempt-rt.scc | 4 ++ recipes-kernel/linux/linux-toradex_5.15-2.1.x.bb | 50 -------------------- recipes-kernel/linux/linux-toradex_5.15-2.2.x.bb | 50 ++++++++++++++++++++ 23 files changed, 309 insertions(+), 309 deletions(-) delete mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.1.x/0001-Revert-Revert-ARM-9113-1-uaccess-remove-set_fs-imple.patch delete mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.1.x/0001-imx_sc_thermal-prevent-BUG-with-rt-patch.patch delete mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.1.x/0002-arch-arm-Kconfig-prepare-for-rt-patch.patch delete mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.1.x/0002-ddr-perf-prevent-BUG-with-rt-patch.patch delete mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.1.x/0004-Revert-arch-arm-Kconfig-prepare-for-rt-patch.patch delete mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.1.x/0005-Revert-Revert-Revert-ARM-9113-1-uaccess-remove-set_f.patch delete mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt-less-latency.cfg delete mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt-less-latency.scc delete mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt.cfg delete mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt.scc create mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.2.x/0001-Revert-Revert-ARM-9113-1-uaccess-remove-set_fs-imple.patch create mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.2.x/0001-imx_sc_thermal-prevent-BUG-with-rt-patch.patch create mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.2.x/0002-arch-arm-Kconfig-prepare-for-rt-patch.patch create mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.2.x/0002-ddr-perf-prevent-BUG-with-rt-patch.patch create mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.2.x/0004-Revert-arch-arm-Kconfig-prepare-for-rt-patch.patch create mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.2.x/0005-Revert-Revert-Revert-ARM-9113-1-uaccess-remove-set_f.patch create mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt-less-latency.cfg create mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt-less-latency.scc create mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt.cfg create mode 100644 recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt.scc delete mode 100644 recipes-kernel/linux/linux-toradex_5.15-2.1.x.bb create mode 100644 recipes-kernel/linux/linux-toradex_5.15-2.2.x.bb (limited to 'recipes-kernel/linux') diff --git a/recipes-kernel/linux/linux-imx-headers_5%.bbappend b/recipes-kernel/linux/linux-imx-headers_5%.bbappend index e1d8228..36be8d5 100644 --- a/recipes-kernel/linux/linux-imx-headers_5%.bbappend +++ b/recipes-kernel/linux/linux-imx-headers_5%.bbappend @@ -1,5 +1,5 @@ LIC_FILES_CHKSUM:tdx = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" -SRCBRANCH:tdx = "toradex_5.15-2.1.x-imx" +SRCBRANCH:tdx = "toradex_5.15-2.2.x-imx" SRC_URI:tdx = "git://git.toradex.com/linux-toradex.git;protocol=https;branch=${SRCBRANCH}" # Keep that one stable, i.e. use the exact git hash from the NXP BSP. -SRCREV:tdx = "36363d8623ba60858e2632b7d2b70dae932c9a8b" +SRCREV:tdx = "7c13adcd3af7dcd541144655102e1cdb941ad538" diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0001-Revert-Revert-ARM-9113-1-uaccess-remove-set_fs-imple.patch b/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0001-Revert-Revert-ARM-9113-1-uaccess-remove-set_fs-imple.patch deleted file mode 100644 index b2413e8..0000000 --- a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0001-Revert-Revert-ARM-9113-1-uaccess-remove-set_fs-imple.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 8f561f0a27a68205ad7a33b3e0fdaf80fc7f96ea Mon Sep 17 00:00:00 2001 -From: Max Krummenacher -Date: Tue, 9 Aug 2022 14:47:27 +0200 -Subject: [PATCH 1/5] Revert "Revert "ARM: 9113/1: uaccess: remove set_fs() - implementation"" - -Prepare for applying RT-Patch by partly reverting the conflicting -downstream commit. - -This reverts commit ee69377c0fb428a2319ca071bbdbbddbb756cd02. - -Signed-off-by: Max Krummenacher ---- - arch/arm/include/asm/thread_info.h | 1 - - arch/arm/kernel/asm-offsets.c | 1 - - 2 files changed, 2 deletions(-) - -diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h -index bf64b41d47eb..d1f959463e17 100644 ---- a/arch/arm/include/asm/thread_info.h -+++ b/arch/arm/include/asm/thread_info.h -@@ -54,7 +54,6 @@ struct cpu_context_save { - struct thread_info { - unsigned long flags; /* low level flags */ - int preempt_count; /* 0 => preemptable, <0 => bug */ -- mm_segment_t addr_limit; /* address limit */ - struct task_struct *task; /* main task structure */ - __u32 cpu; /* cpu */ - __u32 cpu_domain; /* cpu domain */ -diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c -index 2dc0f59b0053..77a253fe3ff3 100644 ---- a/arch/arm/kernel/asm-offsets.c -+++ b/arch/arm/kernel/asm-offsets.c -@@ -43,7 +43,6 @@ int main(void) - BLANK(); - DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); - DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); -- DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); - DEFINE(TI_TASK, offsetof(struct thread_info, task)); - DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); - DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain)); --- -2.35.3 - diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0001-imx_sc_thermal-prevent-BUG-with-rt-patch.patch b/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0001-imx_sc_thermal-prevent-BUG-with-rt-patch.patch deleted file mode 100644 index 4dc1dae..0000000 --- a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0001-imx_sc_thermal-prevent-BUG-with-rt-patch.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 4e6114a23a21db5741375070add8ccc16697db67 Mon Sep 17 00:00:00 2001 -From: Max Krummenacher -Date: Tue, 24 Sep 2019 14:15:50 +0200 -Subject: [PATCH 1/2] imx_sc_thermal: prevent BUG() with rt patch - -With the RT patch applied the kernel prints a BUG backtrace during boot: - -| BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 - -Prevent this by avoiding the smp_processor_id call and just check both -CPU clusters which may be there in a i.MX8 series SoC. - -Signed-off-by: Max Krummenacher ---- - drivers/thermal/imx_sc_thermal.c | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - -diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c -index 8c5049020cd8..51a6c73315ba 100644 ---- a/drivers/thermal/imx_sc_thermal.c -+++ b/drivers/thermal/imx_sc_thermal.c -@@ -58,6 +58,7 @@ sc_ipc_t tsens_ipcHandle; - static int imx_sc_tsens_get_temp(void *data, int *temp) - { - struct imx_sc_sensor *sensor = data; -+ int hw_id; - sc_err_t sciErr; - int16_t celsius; - int8_t tenths; -@@ -65,14 +66,14 @@ static int imx_sc_tsens_get_temp(void *data, int *temp) - sciErr = sc_misc_get_temp(tsens_ipcHandle, sensor->hw_id, - SC_C_TEMP, &celsius, &tenths); - /* -- * if the SS power domain is down, read temp will fail, so -- * we can return the temp of CPU domain instead. -+ * if the SS power domain is down, read temp will fail, -+ * try the temp of the potentially two CPU domains instead. - */ -- if (sciErr != SC_ERR_NONE) { -- sciErr = sc_misc_get_temp(tsens_ipcHandle, -- sensor_hw_id[topology_physical_package_id(smp_processor_id())], -+ hw_id = 0; -+ while (sciErr != SC_ERR_NONE) { -+ sciErr = sc_misc_get_temp(tsens_ipcHandle, sensor_hw_id[hw_id++], - SC_C_TEMP, &celsius, &tenths); -- if (sciErr != SC_ERR_NONE) { -+ if (hw_id > 1) { - pr_err("read temp sensor:%d failed\n", sensor->hw_id); - return -EINVAL; - } --- -2.20.1 - diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0002-arch-arm-Kconfig-prepare-for-rt-patch.patch b/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0002-arch-arm-Kconfig-prepare-for-rt-patch.patch deleted file mode 100644 index 7dfb476..0000000 --- a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0002-arch-arm-Kconfig-prepare-for-rt-patch.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 8e60810e199661b607557e560b329097dc3fea0e Mon Sep 17 00:00:00 2001 -From: Max Krummenacher -Date: Sun, 13 Nov 2022 13:30:47 +0100 -Subject: [PATCH 2/5] arch/arm/Kconfig: prepare for rt patch - -Prepare for applying the RT patch without fuzz (and revert the -change after the RT patch is applied. - -Signed-off-by: Max Krummenacher ---- - arch/arm/Kconfig | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index ddeca482323d..a8ae17f5740d 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -125,7 +125,6 @@ config ARM - select PCI_SYSCALL if PCI - select PERF_USE_VMALLOC - select RTC_LIB -- select SET_FS - select SYS_SUPPORTS_APM_EMULATION - select TRACE_IRQFLAGS_SUPPORT if !CPU_V7M - # Above selects are sorted alphabetically; please add new ones --- -2.35.3 - diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0002-ddr-perf-prevent-BUG-with-rt-patch.patch b/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0002-ddr-perf-prevent-BUG-with-rt-patch.patch deleted file mode 100644 index 9296878..0000000 --- a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0002-ddr-perf-prevent-BUG-with-rt-patch.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 066e66d9222f70d3e21a7df077ac6b623881c9cc Mon Sep 17 00:00:00 2001 -From: Max Krummenacher -Date: Tue, 24 Sep 2019 14:19:24 +0200 -Subject: [PATCH 2/2] ddr-perf: prevent BUG() with rt patch - -With the RT patch applied the kernel prints a BUG backtrace during boot: - -| BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 - -Prevent this by replacing the smp_processor_id() call with a get_cpu() .. -put_cpu() construct. - -Signed-off-by: Max Krummenacher ---- - drivers/perf/ddr-perf.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/perf/ddr-perf.c b/drivers/perf/ddr-perf.c -index 73fe52ee8b95..744a6454d6a4 100644 ---- a/drivers/perf/ddr-perf.c -+++ b/drivers/perf/ddr-perf.c -@@ -470,7 +470,8 @@ static int ddr_perf_probe(struct platform_device *pdev) - - pmu->devtype = (struct fsl_ddr_devtype_data *)of_id->data; - -- cpumask_set_cpu(smp_processor_id(), &pmu->cpu); -+ cpumask_set_cpu(get_cpu(), &pmu->cpu); -+ put_cpu(); - ret = perf_pmu_register(&(pmu->pmu), name, -1); - if (ret) - goto ddr_perf_err; --- -2.20.1 - diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0004-Revert-arch-arm-Kconfig-prepare-for-rt-patch.patch b/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0004-Revert-arch-arm-Kconfig-prepare-for-rt-patch.patch deleted file mode 100644 index 5ade25c..0000000 --- a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0004-Revert-arch-arm-Kconfig-prepare-for-rt-patch.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 572fd569bff28f25e83b8466c77ccb821675771a Mon Sep 17 00:00:00 2001 -From: Max Krummenacher -Date: Sun, 13 Nov 2022 13:36:24 +0100 -Subject: [PATCH 4/5] Revert "arch/arm/Kconfig: prepare for rt patch" - -This reverts commit 8e60810e199661b607557e560b329097dc3fea0e. -Revert the changes made to make the RT-Patch apply. - -Signed-off-by: Max Krummenacher ---- - arch/arm/Kconfig | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig -index 0e8631b96e0f..d5b9364334e0 100644 ---- a/arch/arm/Kconfig -+++ b/arch/arm/Kconfig -@@ -128,6 +128,7 @@ config ARM - select PERF_USE_VMALLOC - select HAVE_POSIX_CPU_TIMERS_TASK_WORK if !KVM - select RTC_LIB -+ select SET_FS - select SYS_SUPPORTS_APM_EMULATION - select TRACE_IRQFLAGS_SUPPORT if !CPU_V7M - # Above selects are sorted alphabetically; please add new ones --- -2.35.3 - diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0005-Revert-Revert-Revert-ARM-9113-1-uaccess-remove-set_f.patch b/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0005-Revert-Revert-Revert-ARM-9113-1-uaccess-remove-set_f.patch deleted file mode 100644 index f98060a..0000000 --- a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/0005-Revert-Revert-Revert-ARM-9113-1-uaccess-remove-set_f.patch +++ /dev/null @@ -1,42 +0,0 @@ -From d162134a09f5036bb1d34c8c3ae8091b8851e1f9 Mon Sep 17 00:00:00 2001 -From: Max Krummenacher -Date: Tue, 9 Aug 2022 14:56:10 +0200 -Subject: [PATCH 5/5] Revert "Revert "Revert "ARM: 9113/1: uaccess: remove - set_fs() implementation""" - -This reverts commit 8f561f0a27a68205ad7a33b3e0fdaf80fc7f96ea -Revert the changes made to make the RT-Patch apply. - -Signed-off-by: Max Krummenacher ---- - arch/arm/include/asm/thread_info.h | 1 + - arch/arm/kernel/asm-offsets.c | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h -index c15dbffabf99..fc6f70b83ba1 100644 ---- a/arch/arm/include/asm/thread_info.h -+++ b/arch/arm/include/asm/thread_info.h -@@ -55,6 +55,7 @@ struct thread_info { - unsigned long flags; /* low level flags */ - int preempt_count; /* 0 => preemptable, <0 => bug */ - int preempt_lazy_count; /* 0 => preemptable, <0 => bug */ -+ mm_segment_t addr_limit; /* address limit */ - struct task_struct *task; /* main task structure */ - __u32 cpu; /* cpu */ - __u32 cpu_domain; /* cpu domain */ -diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c -index addef75db054..997d7ff758f9 100644 ---- a/arch/arm/kernel/asm-offsets.c -+++ b/arch/arm/kernel/asm-offsets.c -@@ -44,6 +44,7 @@ int main(void) - DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); - DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); - DEFINE(TI_PREEMPT_LAZY, offsetof(struct thread_info, preempt_lazy_count)); -+ DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); - DEFINE(TI_TASK, offsetof(struct thread_info, task)); - DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); - DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain)); --- -2.35.3 - diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt-less-latency.cfg b/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt-less-latency.cfg deleted file mode 100644 index a9c88bd..0000000 --- a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt-less-latency.cfg +++ /dev/null @@ -1,14 +0,0 @@ -# CONFIG_PM_DEBUG is not set -# CONFIG_6LOWPAN_DEBUGFS is not set -# CONFIG_BT_DEBUGFS is not set -# CONFIG_ATH9K_DEBUGFS is not set -# CONFIG_ATH9K_HTC_DEBUGFS is not set -# CONFIG_ATH10K_DEBUGFS is not set -# CONFIG_RTLWIFI_DEBUG is not set -# CONFIG_IEEE802154_AT86RF230_DEBUGFS is not set -# CONFIG_DYNAMIC_DEBUG is not set -# CONFIG_DETECT_HUNG_TASK is not set -# CONFIG_SCHEDSTATS is not set -# CONFIG_SCHED_DEBUG is not set -# CONFIG_BLK_DEV_IO_TRACE is not set -# CONFIG_CORESIGHT is not set diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt-less-latency.scc b/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt-less-latency.scc deleted file mode 100644 index edd1519..0000000 --- a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt-less-latency.scc +++ /dev/null @@ -1,4 +0,0 @@ -define KFEATURE_DESCRIPTION "Disable configs that could lead to preempt-rt latency" -define KFEATURE_COMPATIBILITY board - -kconf non-hardware preempt-rt-less-latency.cfg diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt.cfg b/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt.cfg deleted file mode 100644 index 17b06b1..0000000 --- a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt.cfg +++ /dev/null @@ -1,6 +0,0 @@ -CONFIG_EXPERT=y -# CONFIG_KVM is not set -# CONFIG_PREEMPT_NONE is not set -# CONFIG_PREEMPT_VOLUNTARY is not set -# CONFIG_PREEMPT is not set -CONFIG_PREEMPT_RT=y diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt.scc b/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt.scc deleted file mode 100644 index 82d27dc..0000000 --- a/recipes-kernel/linux/linux-toradex-5.15-2.1.x/preempt-rt.scc +++ /dev/null @@ -1,4 +0,0 @@ -define KFEATURE_DESCRIPTION "Enable Features needed by preempt-rt" -define KFEATURE_COMPATIBILITY board - -kconf non-hardware preempt-rt.cfg diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0001-Revert-Revert-ARM-9113-1-uaccess-remove-set_fs-imple.patch b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0001-Revert-Revert-ARM-9113-1-uaccess-remove-set_fs-imple.patch new file mode 100644 index 0000000..b2413e8 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0001-Revert-Revert-ARM-9113-1-uaccess-remove-set_fs-imple.patch @@ -0,0 +1,44 @@ +From 8f561f0a27a68205ad7a33b3e0fdaf80fc7f96ea Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Tue, 9 Aug 2022 14:47:27 +0200 +Subject: [PATCH 1/5] Revert "Revert "ARM: 9113/1: uaccess: remove set_fs() + implementation"" + +Prepare for applying RT-Patch by partly reverting the conflicting +downstream commit. + +This reverts commit ee69377c0fb428a2319ca071bbdbbddbb756cd02. + +Signed-off-by: Max Krummenacher +--- + arch/arm/include/asm/thread_info.h | 1 - + arch/arm/kernel/asm-offsets.c | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h +index bf64b41d47eb..d1f959463e17 100644 +--- a/arch/arm/include/asm/thread_info.h ++++ b/arch/arm/include/asm/thread_info.h +@@ -54,7 +54,6 @@ struct cpu_context_save { + struct thread_info { + unsigned long flags; /* low level flags */ + int preempt_count; /* 0 => preemptable, <0 => bug */ +- mm_segment_t addr_limit; /* address limit */ + struct task_struct *task; /* main task structure */ + __u32 cpu; /* cpu */ + __u32 cpu_domain; /* cpu domain */ +diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c +index 2dc0f59b0053..77a253fe3ff3 100644 +--- a/arch/arm/kernel/asm-offsets.c ++++ b/arch/arm/kernel/asm-offsets.c +@@ -43,7 +43,6 @@ int main(void) + BLANK(); + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); +- DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); + DEFINE(TI_TASK, offsetof(struct thread_info, task)); + DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); + DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain)); +-- +2.35.3 + diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0001-imx_sc_thermal-prevent-BUG-with-rt-patch.patch b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0001-imx_sc_thermal-prevent-BUG-with-rt-patch.patch new file mode 100644 index 0000000..4dc1dae --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0001-imx_sc_thermal-prevent-BUG-with-rt-patch.patch @@ -0,0 +1,53 @@ +From 4e6114a23a21db5741375070add8ccc16697db67 Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Tue, 24 Sep 2019 14:15:50 +0200 +Subject: [PATCH 1/2] imx_sc_thermal: prevent BUG() with rt patch + +With the RT patch applied the kernel prints a BUG backtrace during boot: + +| BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 + +Prevent this by avoiding the smp_processor_id call and just check both +CPU clusters which may be there in a i.MX8 series SoC. + +Signed-off-by: Max Krummenacher +--- + drivers/thermal/imx_sc_thermal.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/drivers/thermal/imx_sc_thermal.c b/drivers/thermal/imx_sc_thermal.c +index 8c5049020cd8..51a6c73315ba 100644 +--- a/drivers/thermal/imx_sc_thermal.c ++++ b/drivers/thermal/imx_sc_thermal.c +@@ -58,6 +58,7 @@ sc_ipc_t tsens_ipcHandle; + static int imx_sc_tsens_get_temp(void *data, int *temp) + { + struct imx_sc_sensor *sensor = data; ++ int hw_id; + sc_err_t sciErr; + int16_t celsius; + int8_t tenths; +@@ -65,14 +66,14 @@ static int imx_sc_tsens_get_temp(void *data, int *temp) + sciErr = sc_misc_get_temp(tsens_ipcHandle, sensor->hw_id, + SC_C_TEMP, &celsius, &tenths); + /* +- * if the SS power domain is down, read temp will fail, so +- * we can return the temp of CPU domain instead. ++ * if the SS power domain is down, read temp will fail, ++ * try the temp of the potentially two CPU domains instead. + */ +- if (sciErr != SC_ERR_NONE) { +- sciErr = sc_misc_get_temp(tsens_ipcHandle, +- sensor_hw_id[topology_physical_package_id(smp_processor_id())], ++ hw_id = 0; ++ while (sciErr != SC_ERR_NONE) { ++ sciErr = sc_misc_get_temp(tsens_ipcHandle, sensor_hw_id[hw_id++], + SC_C_TEMP, &celsius, &tenths); +- if (sciErr != SC_ERR_NONE) { ++ if (hw_id > 1) { + pr_err("read temp sensor:%d failed\n", sensor->hw_id); + return -EINVAL; + } +-- +2.20.1 + diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0002-arch-arm-Kconfig-prepare-for-rt-patch.patch b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0002-arch-arm-Kconfig-prepare-for-rt-patch.patch new file mode 100644 index 0000000..7dfb476 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0002-arch-arm-Kconfig-prepare-for-rt-patch.patch @@ -0,0 +1,28 @@ +From 8e60810e199661b607557e560b329097dc3fea0e Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Sun, 13 Nov 2022 13:30:47 +0100 +Subject: [PATCH 2/5] arch/arm/Kconfig: prepare for rt patch + +Prepare for applying the RT patch without fuzz (and revert the +change after the RT patch is applied. + +Signed-off-by: Max Krummenacher +--- + arch/arm/Kconfig | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index ddeca482323d..a8ae17f5740d 100644 +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -125,7 +125,6 @@ config ARM + select PCI_SYSCALL if PCI + select PERF_USE_VMALLOC + select RTC_LIB +- select SET_FS + select SYS_SUPPORTS_APM_EMULATION + select TRACE_IRQFLAGS_SUPPORT if !CPU_V7M + # Above selects are sorted alphabetically; please add new ones +-- +2.35.3 + diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0002-ddr-perf-prevent-BUG-with-rt-patch.patch b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0002-ddr-perf-prevent-BUG-with-rt-patch.patch new file mode 100644 index 0000000..9296878 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0002-ddr-perf-prevent-BUG-with-rt-patch.patch @@ -0,0 +1,34 @@ +From 066e66d9222f70d3e21a7df077ac6b623881c9cc Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Tue, 24 Sep 2019 14:19:24 +0200 +Subject: [PATCH 2/2] ddr-perf: prevent BUG() with rt patch + +With the RT patch applied the kernel prints a BUG backtrace during boot: + +| BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1 + +Prevent this by replacing the smp_processor_id() call with a get_cpu() .. +put_cpu() construct. + +Signed-off-by: Max Krummenacher +--- + drivers/perf/ddr-perf.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/perf/ddr-perf.c b/drivers/perf/ddr-perf.c +index 73fe52ee8b95..744a6454d6a4 100644 +--- a/drivers/perf/ddr-perf.c ++++ b/drivers/perf/ddr-perf.c +@@ -470,7 +470,8 @@ static int ddr_perf_probe(struct platform_device *pdev) + + pmu->devtype = (struct fsl_ddr_devtype_data *)of_id->data; + +- cpumask_set_cpu(smp_processor_id(), &pmu->cpu); ++ cpumask_set_cpu(get_cpu(), &pmu->cpu); ++ put_cpu(); + ret = perf_pmu_register(&(pmu->pmu), name, -1); + if (ret) + goto ddr_perf_err; +-- +2.20.1 + diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0004-Revert-arch-arm-Kconfig-prepare-for-rt-patch.patch b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0004-Revert-arch-arm-Kconfig-prepare-for-rt-patch.patch new file mode 100644 index 0000000..5ade25c --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0004-Revert-arch-arm-Kconfig-prepare-for-rt-patch.patch @@ -0,0 +1,28 @@ +From 572fd569bff28f25e83b8466c77ccb821675771a Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Sun, 13 Nov 2022 13:36:24 +0100 +Subject: [PATCH 4/5] Revert "arch/arm/Kconfig: prepare for rt patch" + +This reverts commit 8e60810e199661b607557e560b329097dc3fea0e. +Revert the changes made to make the RT-Patch apply. + +Signed-off-by: Max Krummenacher +--- + arch/arm/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig +index 0e8631b96e0f..d5b9364334e0 100644 +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -128,6 +128,7 @@ config ARM + select PERF_USE_VMALLOC + select HAVE_POSIX_CPU_TIMERS_TASK_WORK if !KVM + select RTC_LIB ++ select SET_FS + select SYS_SUPPORTS_APM_EMULATION + select TRACE_IRQFLAGS_SUPPORT if !CPU_V7M + # Above selects are sorted alphabetically; please add new ones +-- +2.35.3 + diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0005-Revert-Revert-Revert-ARM-9113-1-uaccess-remove-set_f.patch b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0005-Revert-Revert-Revert-ARM-9113-1-uaccess-remove-set_f.patch new file mode 100644 index 0000000..f98060a --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/0005-Revert-Revert-Revert-ARM-9113-1-uaccess-remove-set_f.patch @@ -0,0 +1,42 @@ +From d162134a09f5036bb1d34c8c3ae8091b8851e1f9 Mon Sep 17 00:00:00 2001 +From: Max Krummenacher +Date: Tue, 9 Aug 2022 14:56:10 +0200 +Subject: [PATCH 5/5] Revert "Revert "Revert "ARM: 9113/1: uaccess: remove + set_fs() implementation""" + +This reverts commit 8f561f0a27a68205ad7a33b3e0fdaf80fc7f96ea +Revert the changes made to make the RT-Patch apply. + +Signed-off-by: Max Krummenacher +--- + arch/arm/include/asm/thread_info.h | 1 + + arch/arm/kernel/asm-offsets.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h +index c15dbffabf99..fc6f70b83ba1 100644 +--- a/arch/arm/include/asm/thread_info.h ++++ b/arch/arm/include/asm/thread_info.h +@@ -55,6 +55,7 @@ struct thread_info { + unsigned long flags; /* low level flags */ + int preempt_count; /* 0 => preemptable, <0 => bug */ + int preempt_lazy_count; /* 0 => preemptable, <0 => bug */ ++ mm_segment_t addr_limit; /* address limit */ + struct task_struct *task; /* main task structure */ + __u32 cpu; /* cpu */ + __u32 cpu_domain; /* cpu domain */ +diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c +index addef75db054..997d7ff758f9 100644 +--- a/arch/arm/kernel/asm-offsets.c ++++ b/arch/arm/kernel/asm-offsets.c +@@ -44,6 +44,7 @@ int main(void) + DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); + DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); + DEFINE(TI_PREEMPT_LAZY, offsetof(struct thread_info, preempt_lazy_count)); ++ DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); + DEFINE(TI_TASK, offsetof(struct thread_info, task)); + DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); + DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain)); +-- +2.35.3 + diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt-less-latency.cfg b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt-less-latency.cfg new file mode 100644 index 0000000..a9c88bd --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt-less-latency.cfg @@ -0,0 +1,14 @@ +# CONFIG_PM_DEBUG is not set +# CONFIG_6LOWPAN_DEBUGFS is not set +# CONFIG_BT_DEBUGFS is not set +# CONFIG_ATH9K_DEBUGFS is not set +# CONFIG_ATH9K_HTC_DEBUGFS is not set +# CONFIG_ATH10K_DEBUGFS is not set +# CONFIG_RTLWIFI_DEBUG is not set +# CONFIG_IEEE802154_AT86RF230_DEBUGFS is not set +# CONFIG_DYNAMIC_DEBUG is not set +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_SCHED_DEBUG is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_CORESIGHT is not set diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt-less-latency.scc b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt-less-latency.scc new file mode 100644 index 0000000..edd1519 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt-less-latency.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Disable configs that could lead to preempt-rt latency" +define KFEATURE_COMPATIBILITY board + +kconf non-hardware preempt-rt-less-latency.cfg diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt.cfg b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt.cfg new file mode 100644 index 0000000..17b06b1 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt.cfg @@ -0,0 +1,6 @@ +CONFIG_EXPERT=y +# CONFIG_KVM is not set +# CONFIG_PREEMPT_NONE is not set +# CONFIG_PREEMPT_VOLUNTARY is not set +# CONFIG_PREEMPT is not set +CONFIG_PREEMPT_RT=y diff --git a/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt.scc b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt.scc new file mode 100644 index 0000000..82d27dc --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-5.15-2.2.x/preempt-rt.scc @@ -0,0 +1,4 @@ +define KFEATURE_DESCRIPTION "Enable Features needed by preempt-rt" +define KFEATURE_COMPATIBILITY board + +kconf non-hardware preempt-rt.cfg diff --git a/recipes-kernel/linux/linux-toradex_5.15-2.1.x.bb b/recipes-kernel/linux/linux-toradex_5.15-2.1.x.bb deleted file mode 100644 index 4209371..0000000 --- a/recipes-kernel/linux/linux-toradex_5.15-2.1.x.bb +++ /dev/null @@ -1,50 +0,0 @@ -FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-${PV}:" -require recipes-kernel/linux/linux-imx.inc - -SUMMARY = "Linux kernel for Toradex Freescale i.MX based modules" -SUMMARY:preempt-rt = "Real-Time Linux kernel for Toradex Freescale i.MX based modules" - -LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" - -SRC_URI = " \ - git://git.toradex.com/linux-toradex.git;protocol=https;branch=${SRCBRANCH};name=machine \ -" - -# Load USB functions configurable through configfs (CONFIG_USB_CONFIGFS) -KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget', ' libcomposite', '',d)}" - -inherit toradex-kernel-deploy-config toradex-kernel-localversion -LINUX_VERSION = "5.15.77" -# skip, as with use-head-next LINUX_VERSION might be set wrongly -KERNEL_VERSION_SANITY_SKIP = "1" - -SRCBRANCH = "toradex_5.15-2.1.x-imx" -SRCREV_machine = "ddc6ca4d76ea764aaec9837fb9c82297473e6edc" -SRCREV_machine:use-head-next = "${AUTOREV}" - -DEPENDS += "bc-native" -COMPATIBLE_MACHINE = "mx8-nxp-bsp" - -KBUILD_DEFCONFIG:mx8-nxp-bsp ?= "toradex_defconfig" - -export DTC_FLAGS = "-@" - -############################################################################### -# Apply the RT patch and change the configuration to use PREMPT_RT when the -# preempt-rt override is set. -############################################################################### - -# patches get moved into the 'older' directory when superseeded, so provide -# both possible storage locations. -MIRRORS:append:preempt-rt = "${KERNELORG_MIRROR}/linux/kernel/projects/rt/5.15/older/ ${KERNELORG_MIRROR}/linux/kernel/projects/rt/5.15/" -SRC_URI:append:preempt-rt = " \ - file://0001-Revert-Revert-ARM-9113-1-uaccess-remove-set_fs-imple.patch \ - file://0002-arch-arm-Kconfig-prepare-for-rt-patch.patch \ - ${KERNELORG_MIRROR}/linux/kernel/projects/rt/5.15/older/patch-5.15.76-rt53.patch.xz;name=rt-patch \ - file://0004-Revert-arch-arm-Kconfig-prepare-for-rt-patch.patch \ - file://0005-Revert-Revert-Revert-ARM-9113-1-uaccess-remove-set_f.patch \ - file://preempt-rt.scc \ - file://preempt-rt-less-latency.scc \ -" - -SRC_URI[rt-patch.sha256sum] = "737fc31835e774fe970e7eb9c799df55393bd21e6d5a0136cd5e63fe154805c2" diff --git a/recipes-kernel/linux/linux-toradex_5.15-2.2.x.bb b/recipes-kernel/linux/linux-toradex_5.15-2.2.x.bb new file mode 100644 index 0000000..eb47818 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex_5.15-2.2.x.bb @@ -0,0 +1,50 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-${PV}:" +require recipes-kernel/linux/linux-imx.inc + +SUMMARY = "Linux kernel for Toradex Freescale i.MX based modules" +SUMMARY:preempt-rt = "Real-Time Linux kernel for Toradex Freescale i.MX based modules" + +LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46" + +SRC_URI = " \ + git://git.toradex.com/linux-toradex.git;protocol=https;branch=${SRCBRANCH};name=machine \ +" + +# Load USB functions configurable through configfs (CONFIG_USB_CONFIGFS) +KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget', ' libcomposite', '',d)}" + +inherit toradex-kernel-deploy-config toradex-kernel-localversion +LINUX_VERSION = "5.15.125" +# skip, as with use-head-next LINUX_VERSION might be set wrongly +KERNEL_VERSION_SANITY_SKIP = "1" + +SRCBRANCH = "toradex_5.15-2.2.x-imx" +SRCREV_machine = "626df3983254bccebc2584b90e615ad89f79cf46" +SRCREV_machine:use-head-next = "${AUTOREV}" + +DEPENDS += "bc-native" +COMPATIBLE_MACHINE = "mx8-nxp-bsp" + +KBUILD_DEFCONFIG:mx8-nxp-bsp ?= "toradex_defconfig" + +export DTC_FLAGS = "-@" + +############################################################################### +# Apply the RT patch and change the configuration to use PREMPT_RT when the +# preempt-rt override is set. +############################################################################### + +# patches get moved into the 'older' directory when superseeded, so provide +# both possible storage locations. +MIRRORS:append:preempt-rt = "${KERNELORG_MIRROR}/linux/kernel/projects/rt/5.15/older/ ${KERNELORG_MIRROR}/linux/kernel/projects/rt/5.15/" +SRC_URI:append:preempt-rt = " \ + file://0001-Revert-Revert-ARM-9113-1-uaccess-remove-set_fs-imple.patch \ + file://0002-arch-arm-Kconfig-prepare-for-rt-patch.patch \ + ${KERNELORG_MIRROR}/linux/kernel/projects/rt/5.15/older/patch-5.15.125-rt66.patch.xz;name=rt-patch \ + file://0004-Revert-arch-arm-Kconfig-prepare-for-rt-patch.patch \ + file://0005-Revert-Revert-Revert-ARM-9113-1-uaccess-remove-set_f.patch \ + file://preempt-rt.scc \ + file://preempt-rt-less-latency.scc \ +" + +SRC_URI[rt-patch.sha256sum] = "4bb33ab169af60e7f7f6b835e91aa0c17ce4563b00a3c1b35800258f9b678d46" -- cgit v1.2.3