diff options
Diffstat (limited to 'recipes-kernel/linux/linux-toradex-5.15-2.2.x')
10 files changed, 257 insertions, 0 deletions
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 <max.krummenacher@toradex.com> +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 <max.krummenacher@toradex.com> +--- + 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 <max.krummenacher@toradex.com> +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 <max.krummenacher@toradex.com> +--- + 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 <max.krummenacher@toradex.com> +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 <max.krummenacher@toradex.com> +--- + 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 <max.krummenacher@toradex.com> +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 <max.krummenacher@toradex.com> +--- + 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 <max.krummenacher@toradex.com> +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 <max.krummenacher@toradex.com> +--- + 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 <max.krummenacher@toradex.com> +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 <max.krummenacher@toradex.com> +--- + 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 |