summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-12-10 17:32:06 +0100
committerPhilippe Schenker <philippe.schenker@toradex.com>2018-12-27 16:45:52 +0100
commit58af5f8ccb2f29acf4fd0182521f793c9e10d68e (patch)
treee7ec9f88ce462e8a0a831f9e77b2c36858dd1725 /recipes-kernel/linux
parente25cc381c7ceeb325a038308c414975844ac7864 (diff)
linux kernel: update to 4.9.144 based fslc
Update to L4.9.123-2.3.0_8mm_ga release. Update to branch toradex_4.9-2.3.x-imx based on 4.9-2.3.x-imx branch of linux-fslc currently re-based to 4.9.144. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Philippe Schenker <philippe.schenker@toradex.com>
Diffstat (limited to 'recipes-kernel/linux')
-rw-r--r--recipes-kernel/linux/linux-toradex-4.9-2.3.x/apalis-imx6/defconfig (renamed from recipes-kernel/linux/linux-toradex-4.9-1.0.x/apalis-imx6/defconfig)0
-rw-r--r--recipes-kernel/linux/linux-toradex-4.9-2.3.x/colibri-imx6/defconfig (renamed from recipes-kernel/linux/linux-toradex-4.9-1.0.x/colibri-imx6/defconfig)0
-rw-r--r--recipes-kernel/linux/linux-toradex-4.9-2.3.x/colibri-imx6ull/defconfig (renamed from recipes-kernel/linux/linux-toradex-4.9-1.0.x/colibri-imx6ull/defconfig)0
-rw-r--r--recipes-kernel/linux/linux-toradex-4.9-2.3.x/mx7/defconfig (renamed from recipes-kernel/linux/linux-toradex-4.9-1.0.x/mx7/defconfig)1
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0001-Revert-timers-Forward-timer-base-before-migrating-ti.patch35
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0001-gpu-viv-enable-PREEMPT-RT-fixes.patch46
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0003-timers-Forward-timer-base-before-migrating-timers.patch88
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/0002-mm-Work-around-the-oops-below-by-disabling-split-ptl.patch (renamed from recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0002-mm-Work-around-the-oops-below-by-disabling-split-ptl.patch)0
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/001.patch11
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/001b.patch34
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002.patch95
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002b.patch11
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002c.patch116
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002d.patch18
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002e.patch58
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002f.patch42
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002g.patch53
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002h.patch10
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002i.patch114
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002j.patch239
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002k.patch31
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002l.patch19
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/003.patch39
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/004.patch86
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/apalis-imx6/defconfig (renamed from recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/apalis-imx6/defconfig)0
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/colibri-imx6/defconfig (renamed from recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/colibri-imx6/defconfig)0
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/colibri-imx6ull/defconfig (renamed from recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/colibri-imx6ull/defconfig)0
-rw-r--r--recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/mx7/defconfig (renamed from recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/mx7/defconfig)1
-rw-r--r--recipes-kernel/linux/linux-toradex-rt_4.4.bb8
-rw-r--r--recipes-kernel/linux/linux-toradex-rt_4.9-1.0.x.bb18
-rw-r--r--recipes-kernel/linux/linux-toradex-rt_4.9-2.3.x.bb31
-rw-r--r--recipes-kernel/linux/linux-toradex_4.4.bbappend2
-rw-r--r--recipes-kernel/linux/linux-toradex_4.9-2.3.x.bb (renamed from recipes-kernel/linux/linux-toradex_4.9-1.0.x.bb)6
33 files changed, 1017 insertions, 195 deletions
diff --git a/recipes-kernel/linux/linux-toradex-4.9-1.0.x/apalis-imx6/defconfig b/recipes-kernel/linux/linux-toradex-4.9-2.3.x/apalis-imx6/defconfig
index 657a5bd..657a5bd 100644
--- a/recipes-kernel/linux/linux-toradex-4.9-1.0.x/apalis-imx6/defconfig
+++ b/recipes-kernel/linux/linux-toradex-4.9-2.3.x/apalis-imx6/defconfig
diff --git a/recipes-kernel/linux/linux-toradex-4.9-1.0.x/colibri-imx6/defconfig b/recipes-kernel/linux/linux-toradex-4.9-2.3.x/colibri-imx6/defconfig
index e596873..e596873 100644
--- a/recipes-kernel/linux/linux-toradex-4.9-1.0.x/colibri-imx6/defconfig
+++ b/recipes-kernel/linux/linux-toradex-4.9-2.3.x/colibri-imx6/defconfig
diff --git a/recipes-kernel/linux/linux-toradex-4.9-1.0.x/colibri-imx6ull/defconfig b/recipes-kernel/linux/linux-toradex-4.9-2.3.x/colibri-imx6ull/defconfig
index 18cd125..18cd125 100644
--- a/recipes-kernel/linux/linux-toradex-4.9-1.0.x/colibri-imx6ull/defconfig
+++ b/recipes-kernel/linux/linux-toradex-4.9-2.3.x/colibri-imx6ull/defconfig
diff --git a/recipes-kernel/linux/linux-toradex-4.9-1.0.x/mx7/defconfig b/recipes-kernel/linux/linux-toradex-4.9-2.3.x/mx7/defconfig
index 6abe92c..b9195e2 100644
--- a/recipes-kernel/linux/linux-toradex-4.9-1.0.x/mx7/defconfig
+++ b/recipes-kernel/linux/linux-toradex-4.9-2.3.x/mx7/defconfig
@@ -35,6 +35,7 @@ CONFIG_SOC_IMX7D=y
CONFIG_SMP=y
# CONFIG_ARM_CPU_TOPOLOGY is not set
CONFIG_VMSPLIT_2G=y
+CONFIG_ARM_PSCI=y
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_AEABI=y
CONFIG_CMA=y
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0001-Revert-timers-Forward-timer-base-before-migrating-ti.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0001-Revert-timers-Forward-timer-base-before-migrating-ti.patch
deleted file mode 100644
index 7656ab6..0000000
--- a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0001-Revert-timers-Forward-timer-base-before-migrating-ti.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 4e529c1110601d9ecc941e74e6711f3aefa36f88 Mon Sep 17 00:00:00 2001
-From: Max Krummenacher <max.krummenacher@toradex.com>
-Date: Tue, 26 Jun 2018 20:41:38 +0200
-Subject: [PATCH 1/3] Revert "timers: Forward timer base before migrating
- timers"
-
-Prepare to apply rt patch and reapply afterwards.
-
-This reverts commit 13e75c74cd69ca460778fad5ab902f0b20869267.
-
-Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
----
- kernel/time/timer.c | 6 ------
- 1 file changed, 6 deletions(-)
-
-diff --git a/kernel/time/timer.c b/kernel/time/timer.c
-index 7c477912f36d..2d5cc7dfee14 100644
---- a/kernel/time/timer.c
-+++ b/kernel/time/timer.c
-@@ -1884,12 +1884,6 @@ int timers_dead_cpu(unsigned int cpu)
- spin_lock_irq(&new_base->lock);
- spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING);
-
-- /*
-- * The current CPUs base clock might be stale. Update it
-- * before moving the timers over.
-- */
-- forward_timer_base(new_base);
--
- BUG_ON(old_base->running_timer);
-
- for (i = 0; i < WHEEL_SIZE; i++)
---
-2.13.6
-
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0001-gpu-viv-enable-PREEMPT-RT-fixes.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0001-gpu-viv-enable-PREEMPT-RT-fixes.patch
deleted file mode 100644
index 238f23e..0000000
--- a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0001-gpu-viv-enable-PREEMPT-RT-fixes.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 3a72b4b868fe160f57817fa54cc14aa235391970 Mon Sep 17 00:00:00 2001
-From: Stefan Agner <stefan.agner@toradex.com>
-Date: Wed, 24 Jan 2018 16:35:37 +0100
-Subject: [PATCH 1/2] gpu-viv: enable PREEMPT RT fixes
-
-Set the preprocessor define gcdRT_KERNEL to enable PREEMPT RT
-kernel ifdefs. Use new macro DECLARE_SWAITQUEUE to declare the
-simple wait queue.
-
-Upstream-Status: Inappropriate [vendor kernel specific]
-
-Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
----
- drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h | 2 ++
- drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 2 +-
- 2 files changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
-index 32233cc3418e..fed9448d216e 100644
---- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
-+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
-@@ -115,6 +115,8 @@
-
- #define GetPageCount(size, offset) ((((size) + ((offset) & ~PAGE_MASK)) + PAGE_SIZE - 1) >> PAGE_SHIFT)
-
-+#define gcdRT_KERNEL
-+
- #if LINUX_VERSION_CODE >= KERNEL_VERSION (3,7,0)
- #define gcdVM_FLAGS (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_DONTDUMP)
- #else
-diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-index 9bf60450f976..46ba3c6839ac 100644
---- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-@@ -6063,7 +6063,7 @@ gckOS_WaitSignal(
- : msecs_to_jiffies(Wait);
-
- #ifdef gcdRT_KERNEL
-- DEFINE_SWAITER(wait);
-+ DECLARE_SWAITQUEUE(wait);
- #else
- DECLARE_WAITQUEUE(wait, current);
- wait.flags |= WQ_FLAG_EXCLUSIVE;
---
-2.15.1
-
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0003-timers-Forward-timer-base-before-migrating-timers.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0003-timers-Forward-timer-base-before-migrating-timers.patch
deleted file mode 100644
index a6c70d8..0000000
--- a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0003-timers-Forward-timer-base-before-migrating-timers.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 030a2d50079f1a8c6319fa6a026c03e43c3f87f6 Mon Sep 17 00:00:00 2001
-From: Lingutla Chandrasekhar <clingutla@codeaurora.org>
-Date: Thu, 18 Jan 2018 17:20:22 +0530
-Subject: [PATCH 3/3] timers: Forward timer base before migrating timers
-
-commit c52232a49e203a65a6e1a670cd5262f59e9364a0 upstream.
-
-On CPU hotunplug the enqueued timers of the unplugged CPU are migrated to a
-live CPU. This happens from the control thread which initiated the unplug.
-
-If the CPU on which the control thread runs came out from a longer idle
-period then the base clock of that CPU might be stale because the control
-thread runs prior to any event which forwards the clock.
-
-In such a case the timers from the unplugged CPU are queued on the live CPU
-based on the stale clock which can cause large delays due to increased
-granularity of the outer timer wheels which are far away from base:;clock.
-
-But there is a worse problem than that. The following sequence of events
-illustrates it:
-
- - CPU0 timer1 is queued expires = 59969 and base->clk = 59131.
-
- The timer is queued at wheel level 2, with resulting expiry time = 60032
- (due to level granularity).
-
- - CPU1 enters idle @60007, with next timer expiry @60020.
-
- - CPU0 is hotplugged at @60009
-
- - CPU1 exits idle and runs the control thread which migrates the
- timers from CPU0
-
- timer1 is now queued in level 0 for immediate handling in the next
- softirq because the requested expiry time 59969 is before CPU1 base->clk
- 60007
-
- - CPU1 runs code which forwards the base clock which succeeds because the
- next expiring timer. which was collected at idle entry time is still set
- to 60020.
-
- So it forwards beyond 60007 and therefore misses to expire the migrated
- timer1. That timer gets expired when the wheel wraps around again, which
- takes between 63 and 630ms depending on the HZ setting.
-
-Address both problems by invoking forward_timer_base() for the control CPUs
-timer base. All other places, which might run into a similar problem
-(mod_timer()/add_timer_on()) already invoke forward_timer_base() to avoid
-that.
-
-[ tglx: Massaged comment and changelog ]
-
-Fixes: a683f390b93f ("timers: Forward the wheel clock whenever possible")
-Co-developed-by: Neeraj Upadhyay <neeraju@codeaurora.org>
-Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
-Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
-Cc: linux-arm-msm@vger.kernel.org
-Cc: stable@vger.kernel.org
-Link: https://lkml.kernel.org/r/20180118115022.6368-1-clingutla@codeaurora.org
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
-(cherry picked from commit 13e75c74cd69ca460778fad5ab902f0b20869267)
----
- kernel/time/timer.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/kernel/time/timer.c b/kernel/time/timer.c
-index ec0169f49c39..00f3db2c6cca 100644
---- a/kernel/time/timer.c
-+++ b/kernel/time/timer.c
-@@ -1919,6 +1919,12 @@ int timers_dead_cpu(unsigned int cpu)
- raw_spin_lock_irq(&new_base->lock);
- raw_spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING);
-
-+ /*
-+ * The current CPUs base clock might be stale. Update it
-+ * before moving the timers over.
-+ */
-+ forward_timer_base(new_base);
-+
- BUG_ON(old_base->running_timer);
-
- for (i = 0; i < WHEEL_SIZE; i++)
---
-2.13.6
-
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0002-mm-Work-around-the-oops-below-by-disabling-split-ptl.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/0002-mm-Work-around-the-oops-below-by-disabling-split-ptl.patch
index 27e2137..27e2137 100644
--- a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/0002-mm-Work-around-the-oops-below-by-disabling-split-ptl.patch
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/0002-mm-Work-around-the-oops-below-by-disabling-split-ptl.patch
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/001.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/001.patch
new file mode 100644
index 0000000..538718a
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/001.patch
@@ -0,0 +1,11 @@
+--- b/init/main.c
++++ a/init/main.c
+@@ -915,7 +915,7 @@
+
+ static noinline void __init kernel_init_freeable(void);
+
++#if defined(CONFIG_DEBUG_RODATA) || defined(CONFIG_SET_MODULE_RONX)
+-#if defined(CONFIG_DEBUG_RODATA) || defined(CONFIG_DEBUG_SET_MODULE_RONX)
+ bool rodata_enabled __ro_after_init = true;
+ static int __init set_debug_rodata(char *str)
+ {
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/001b.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/001b.patch
new file mode 100644
index 0000000..400f7fc
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/001b.patch
@@ -0,0 +1,34 @@
+--- b/include/linux/cpu.h
++++ a/include/linux/cpu.h
+@@ -29,7 +29,7 @@
+ };
+
+ extern void boot_cpu_init(void);
++extern void boot_cpu_state_init(void);
+-extern void boot_cpu_hotplug_init(void);
+
+ extern int register_cpu(struct cpu *cpu, int num);
+ extern struct device *get_cpu_device(unsigned cpu);
+--- b/init/main.c
++++ a/init/main.c
+@@ -509,8 +509,8 @@
+ setup_command_line(command_line);
+ setup_nr_cpu_ids();
+ setup_per_cpu_areas();
++ boot_cpu_state_init();
+ smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
+- boot_cpu_hotplug_init();
+
+ build_all_zonelists(NULL, NULL);
+ page_alloc_init();
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -1944,7 +1944,7 @@
+ /*
+ * Must be called _AFTER_ setting up the per_cpu areas
+ */
++void __init boot_cpu_state_init(void)
+-void __init boot_cpu_hotplug_init(void)
+ {
+ per_cpu_ptr(&cpuhp_state, smp_processor_id())->state = CPUHP_ONLINE;
+ }
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002.patch
new file mode 100644
index 0000000..a61c5e1
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002.patch
@@ -0,0 +1,95 @@
+--- b/arch/x86/include/asm/idle.h
++++ a/arch/x86/include/asm/idle.h
+@@ -1,6 +1,13 @@
+ #ifndef _ASM_X86_IDLE_H
+ #define _ASM_X86_IDLE_H
+
++#define IDLE_START 1
++#define IDLE_END 2
++
++struct notifier_block;
++void idle_notifier_register(struct notifier_block *n);
++void idle_notifier_unregister(struct notifier_block *n);
++
+ #ifdef CONFIG_X86_64
+ void enter_idle(void);
+ void exit_idle(void);
+--- b/arch/x86/kernel/process.c
++++ a/arch/x86/kernel/process.c
+@@ -68,6 +68,19 @@
+
+ #ifdef CONFIG_X86_64
+ static DEFINE_PER_CPU(unsigned char, is_idle);
++static ATOMIC_NOTIFIER_HEAD(idle_notifier);
++
++void idle_notifier_register(struct notifier_block *n)
++{
++ atomic_notifier_chain_register(&idle_notifier, n);
++}
++EXPORT_SYMBOL_GPL(idle_notifier_register);
++
++void idle_notifier_unregister(struct notifier_block *n)
++{
++ atomic_notifier_chain_unregister(&idle_notifier, n);
++}
++EXPORT_SYMBOL_GPL(idle_notifier_unregister);
+ #endif
+
+ /*
+@@ -384,14 +397,14 @@
+ void enter_idle(void)
+ {
+ this_cpu_write(is_idle, 1);
++ atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL);
+- idle_notifier_call_chain(IDLE_START);
+ }
+
+ static void __exit_idle(void)
+ {
+ if (x86_test_and_clear_bit_percpu(0, is_idle) == 0)
+ return;
++ atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
+- idle_notifier_call_chain(IDLE_END);
+ }
+
+ /* Called from interrupts to signify idle end */
+--- b/include/linux/cpu.h
++++ a/include/linux/cpu.h
+@@ -276,11 +276,4 @@
+ static inline void cpu_smt_check_topology(void) { }
+ #endif
+
+-#define IDLE_START 1
+-#define IDLE_END 2
+-
+-void idle_notifier_register(struct notifier_block *n);
+-void idle_notifier_unregister(struct notifier_block *n);
+-void idle_notifier_call_chain(unsigned long val);
+-
+ #endif /* _LINUX_CPU_H_ */
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -2206,23 +2206,3 @@
+ #endif
+ this_cpu_write(cpuhp_state.state, CPUHP_ONLINE);
+ }
+-
+-static ATOMIC_NOTIFIER_HEAD(idle_notifier);
+-
+-void idle_notifier_register(struct notifier_block *n)
+-{
+- atomic_notifier_chain_register(&idle_notifier, n);
+-}
+-EXPORT_SYMBOL_GPL(idle_notifier_register);
+-
+-void idle_notifier_unregister(struct notifier_block *n)
+-{
+- atomic_notifier_chain_unregister(&idle_notifier, n);
+-}
+-EXPORT_SYMBOL_GPL(idle_notifier_unregister);
+-
+-void idle_notifier_call_chain(unsigned long val)
+-{
+- atomic_notifier_call_chain(&idle_notifier, val, NULL);
+-}
+-EXPORT_SYMBOL_GPL(idle_notifier_call_chain);
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002b.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002b.patch
new file mode 100644
index 0000000..1463abf
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002b.patch
@@ -0,0 +1,11 @@
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -2201,8 +2201,6 @@
+ */
+ void __init boot_cpu_hotplug_init(void)
+ {
+-#ifdef CONFIG_SMP
+ this_cpu_write(cpuhp_state.booted_once, true);
+-#endif
+ this_cpu_write(cpuhp_state.state, CPUHP_ONLINE);
+ }
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002c.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002c.patch
new file mode 100644
index 0000000..27951a0
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002c.patch
@@ -0,0 +1,116 @@
+--- b/arch/x86/kernel/cpu/bugs.c
++++ a/arch/x86/kernel/cpu/bugs.c
+@@ -61,7 +61,7 @@
+ * identify_boot_cpu() initialized SMT support information, let the
+ * core code know.
+ */
++ cpu_smt_check_topology();
+- cpu_smt_check_topology_early();
+
+ if (!IS_ENABLED(CONFIG_SMP)) {
+ pr_info("CPU: ");
+--- b/include/linux/cpu.h
++++ a/include/linux/cpu.h
+@@ -267,12 +267,10 @@
+ #if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT)
+ extern enum cpuhp_smt_control cpu_smt_control;
+ extern void cpu_smt_disable(bool force);
+-extern void cpu_smt_check_topology_early(void);
+ extern void cpu_smt_check_topology(void);
+ #else
+ # define cpu_smt_control (CPU_SMT_ENABLED)
+ static inline void cpu_smt_disable(bool force) { }
+-static inline void cpu_smt_check_topology_early(void) { }
+ static inline void cpu_smt_check_topology(void) { }
+ #endif
+
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -360,8 +360,6 @@
+ enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED;
+ EXPORT_SYMBOL_GPL(cpu_smt_control);
+
+-static bool cpu_smt_available __read_mostly;
+-
+ void __init cpu_smt_disable(bool force)
+ {
+ if (cpu_smt_control == CPU_SMT_FORCE_DISABLED ||
+@@ -378,28 +376,14 @@
+
+ /*
+ * The decision whether SMT is supported can only be done after the full
++ * CPU identification. Called from architecture code.
+- * CPU identification. Called from architecture code before non boot CPUs
+- * are brought up.
+ */
++void __init cpu_smt_check_topology(void)
+-void __init cpu_smt_check_topology_early(void)
+ {
+ if (!topology_smt_supported())
+ cpu_smt_control = CPU_SMT_NOT_SUPPORTED;
+ }
+
+-/*
+- * If SMT was disabled by BIOS, detect it here, after the CPUs have been
+- * brought online. This ensures the smt/l1tf sysfs entries are consistent
+- * with reality. cpu_smt_available is set to true during the bringup of non
+- * boot CPUs when a SMT sibling is detected. Note, this may overwrite
+- * cpu_smt_control's previous setting.
+- */
+-void __init cpu_smt_check_topology(void)
+-{
+- if (!cpu_smt_available)
+- cpu_smt_control = CPU_SMT_NOT_SUPPORTED;
+-}
+-
+ static int __init smt_cmdline_disable(char *str)
+ {
+ cpu_smt_disable(str && !strcmp(str, "force"));
+@@ -409,18 +393,10 @@
+
+ static inline bool cpu_smt_allowed(unsigned int cpu)
+ {
++ if (cpu_smt_control == CPU_SMT_ENABLED)
+- if (topology_is_primary_thread(cpu))
+ return true;
+
++ if (topology_is_primary_thread(cpu))
+- /*
+- * If the CPU is not a 'primary' thread and the booted_once bit is
+- * set then the processor has SMT support. Store this information
+- * for the late check of SMT support in cpu_smt_check_topology().
+- */
+- if (per_cpu(cpuhp_state, cpu).booted_once)
+- cpu_smt_available = true;
+-
+- if (cpu_smt_control == CPU_SMT_ENABLED)
+ return true;
+
+ /*
+@@ -2087,6 +2063,15 @@
+
+ static int __init cpu_smt_state_init(void)
+ {
++ /*
++ * If SMT was disabled by BIOS, detect it here, after the CPUs have
++ * been brought online. This ensures the smt/l1tf sysfs entries are
++ * consistent with reality. Note this may overwrite cpu_smt_control's
++ * previous setting.
++ */
++ if (topology_max_smt_threads() == 1)
++ cpu_smt_control = CPU_SMT_NOT_SUPPORTED;
++
+ return sysfs_create_group(&cpu_subsys.dev_root->kobj,
+ &cpuhp_smt_attr_group);
+ }
+--- b/kernel/smp.c
++++ a/kernel/smp.c
+@@ -564,8 +564,6 @@
+ cpu_up(cpu);
+ }
+
+- /* Final decision about SMT support */
+- cpu_smt_check_topology();
+ /* Any cleanup work */
+ smp_announce();
+ smp_cpus_done(setup_max_cpus);
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002d.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002d.patch
new file mode 100644
index 0000000..853223c
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002d.patch
@@ -0,0 +1,18 @@
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -2063,15 +2063,6 @@
+
+ static int __init cpu_smt_state_init(void)
+ {
+- /*
+- * If SMT was disabled by BIOS, detect it here, after the CPUs have
+- * been brought online. This ensures the smt/l1tf sysfs entries are
+- * consistent with reality. Note this may overwrite cpu_smt_control's
+- * previous setting.
+- */
+- if (topology_max_smt_threads() == 1)
+- cpu_smt_control = CPU_SMT_NOT_SUPPORTED;
+-
+ return sysfs_create_group(&cpu_subsys.dev_root->kobj,
+ &cpuhp_smt_attr_group);
+ }
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002e.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002e.patch
new file mode 100644
index 0000000..88419fc
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002e.patch
@@ -0,0 +1,58 @@
+--- b/arch/x86/kernel/cpu/bugs.c
++++ a/arch/x86/kernel/cpu/bugs.c
+@@ -57,12 +57,6 @@
+ {
+ identify_boot_cpu();
+
+- /*
+- * identify_boot_cpu() initialized SMT support information, let the
+- * core code know.
+- */
+- cpu_smt_check_topology();
+-
+ if (!IS_ENABLED(CONFIG_SMP)) {
+ pr_info("CPU: ");
+ print_cpu_info(&boot_cpu_data);
+--- b/include/linux/cpu.h
++++ a/include/linux/cpu.h
+@@ -267,11 +267,9 @@
+ #if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT)
+ extern enum cpuhp_smt_control cpu_smt_control;
+ extern void cpu_smt_disable(bool force);
+-extern void cpu_smt_check_topology(void);
+ #else
+ # define cpu_smt_control (CPU_SMT_ENABLED)
+ static inline void cpu_smt_disable(bool force) { }
+-static inline void cpu_smt_check_topology(void) { }
+ #endif
+
+ #endif /* _LINUX_CPU_H_ */
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -374,16 +374,6 @@
+ }
+ }
+
+-/*
+- * The decision whether SMT is supported can only be done after the full
+- * CPU identification. Called from architecture code.
+- */
+-void __init cpu_smt_check_topology(void)
+-{
+- if (!topology_smt_supported())
+- cpu_smt_control = CPU_SMT_NOT_SUPPORTED;
+-}
+-
+ static int __init smt_cmdline_disable(char *str)
+ {
+ cpu_smt_disable(str && !strcmp(str, "force"));
+@@ -2063,6 +2053,9 @@
+
+ static int __init cpu_smt_state_init(void)
+ {
++ if (!topology_smt_supported())
++ cpu_smt_control = CPU_SMT_NOT_SUPPORTED;
++
+ return sysfs_create_group(&cpu_subsys.dev_root->kobj,
+ &cpuhp_smt_attr_group);
+ }
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002f.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002f.patch
new file mode 100644
index 0000000..f50b1aa
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002f.patch
@@ -0,0 +1,42 @@
+--- b/include/linux/cpu.h
++++ a/include/linux/cpu.h
+@@ -266,10 +266,8 @@
+
+ #if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT)
+ extern enum cpuhp_smt_control cpu_smt_control;
+-extern void cpu_smt_disable(bool force);
+ #else
+ # define cpu_smt_control (CPU_SMT_ENABLED)
+-static inline void cpu_smt_disable(bool force) { }
+ #endif
+
+ #endif /* _LINUX_CPU_H_ */
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -360,23 +360,13 @@
+ enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED;
+ EXPORT_SYMBOL_GPL(cpu_smt_control);
+
++static int __init smt_cmdline_disable(char *str)
+-void __init cpu_smt_disable(bool force)
+ {
++ cpu_smt_control = CPU_SMT_DISABLED;
++ if (str && !strcmp(str, "force")) {
+- if (cpu_smt_control == CPU_SMT_FORCE_DISABLED ||
+- cpu_smt_control == CPU_SMT_NOT_SUPPORTED)
+- return;
+-
+- if (force) {
+ pr_info("SMT: Force disabled\n");
+ cpu_smt_control = CPU_SMT_FORCE_DISABLED;
+- } else {
+- cpu_smt_control = CPU_SMT_DISABLED;
+ }
+-}
+-
+-static int __init smt_cmdline_disable(char *str)
+-{
+- cpu_smt_disable(str && !strcmp(str, "force"));
+ return 0;
+ }
+ early_param("nosmt", smt_cmdline_disable);
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002g.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002g.patch
new file mode 100644
index 0000000..714e97f
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002g.patch
@@ -0,0 +1,53 @@
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -1917,15 +1917,6 @@
+ kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
+ }
+
+-static void cpuhp_online_cpu_device(unsigned int cpu)
+-{
+- struct device *dev = get_cpu_device(cpu);
+-
+- dev->offline = false;
+- /* Tell user space about the state change */
+- kobject_uevent(&dev->kobj, KOBJ_ONLINE);
+-}
+-
+ static int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
+ {
+ int cpu, ret = 0;
+@@ -1958,24 +1949,11 @@
+ return ret;
+ }
+
++static void cpuhp_smt_enable(void)
+-static int cpuhp_smt_enable(void)
+ {
+- int cpu, ret = 0;
+-
+ cpu_maps_update_begin();
+ cpu_smt_control = CPU_SMT_ENABLED;
+- for_each_present_cpu(cpu) {
+- /* Skip online CPUs and CPUs on offline nodes */
+- if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))
+- continue;
+- ret = _cpu_up(cpu, 0, CPUHP_ONLINE);
+- if (ret)
+- break;
+- /* See comment in cpuhp_smt_disable() */
+- cpuhp_online_cpu_device(cpu);
+- }
+ cpu_maps_update_done();
+- return ret;
+ }
+
+ static ssize_t
+@@ -2006,7 +1984,7 @@
+ if (ctrlval != cpu_smt_control) {
+ switch (ctrlval) {
+ case CPU_SMT_ENABLED:
++ cpuhp_smt_enable();
+- ret = cpuhp_smt_enable();
+ break;
+ case CPU_SMT_DISABLED:
+ case CPU_SMT_FORCE_DISABLED:
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002h.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002h.patch
new file mode 100644
index 0000000..578a370
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002h.patch
@@ -0,0 +1,10 @@
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -358,7 +358,6 @@
+
+ #ifdef CONFIG_HOTPLUG_SMT
+ enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED;
+-EXPORT_SYMBOL_GPL(cpu_smt_control);
+
+ static int __init smt_cmdline_disable(char *str)
+ {
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002i.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002i.patch
new file mode 100644
index 0000000..0733908
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002i.patch
@@ -0,0 +1,114 @@
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -54,7 +54,6 @@
+ bool rollback;
+ bool single;
+ bool bringup;
+- bool booted_once;
+ struct hlist_node *node;
+ enum cpuhp_state cb_state;
+ int result;
+@@ -356,40 +355,6 @@
+ EXPORT_SYMBOL_GPL(cpu_hotplug_enable);
+ #endif /* CONFIG_HOTPLUG_CPU */
+
+-#ifdef CONFIG_HOTPLUG_SMT
+-enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED;
+-
+-static int __init smt_cmdline_disable(char *str)
+-{
+- cpu_smt_control = CPU_SMT_DISABLED;
+- if (str && !strcmp(str, "force")) {
+- pr_info("SMT: Force disabled\n");
+- cpu_smt_control = CPU_SMT_FORCE_DISABLED;
+- }
+- return 0;
+-}
+-early_param("nosmt", smt_cmdline_disable);
+-
+-static inline bool cpu_smt_allowed(unsigned int cpu)
+-{
+- if (cpu_smt_control == CPU_SMT_ENABLED)
+- return true;
+-
+- if (topology_is_primary_thread(cpu))
+- return true;
+-
+- /*
+- * On x86 it's required to boot all logical CPUs at least once so
+- * that the init code can get a chance to set CR4.MCE on each
+- * CPU. Otherwise, a broadacasted MCE observing CR4.MCE=0b on any
+- * core will shutdown the machine.
+- */
+- return !per_cpu(cpuhp_state, cpu).booted_once;
+-}
+-#else
+-static inline bool cpu_smt_allowed(unsigned int cpu) { return true; }
+-#endif
+-
+ /* Need to know about CPUs going up/down? */
+ int register_cpu_notifier(struct notifier_block *nb)
+ {
+@@ -466,16 +431,6 @@
+ stop_machine_unpark(cpu);
+ kthread_unpark(st->thread);
+
+- /*
+- * SMT soft disabling on X86 requires to bring the CPU out of the
+- * BIOS 'wait for SIPI' state in order to set the CR4.MCE bit. The
+- * CPU marked itself as booted_once in cpu_notify_starting() so the
+- * cpu_smt_allowed() check will now return false if this is not the
+- * primary sibling.
+- */
+- if (!cpu_smt_allowed(cpu))
+- return -ECANCELED;
+-
+ /* Should we go further up ? */
+ if (st->target > CPUHP_AP_ONLINE_IDLE) {
+ __cpuhp_kick_ap_work(st);
+@@ -1023,6 +978,29 @@
+ EXPORT_SYMBOL(cpu_down);
+ #endif /*CONFIG_HOTPLUG_CPU*/
+
++#ifdef CONFIG_HOTPLUG_SMT
++enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED;
++
++static int __init smt_cmdline_disable(char *str)
++{
++ cpu_smt_control = CPU_SMT_DISABLED;
++ if (str && !strcmp(str, "force")) {
++ pr_info("SMT: Force disabled\n");
++ cpu_smt_control = CPU_SMT_FORCE_DISABLED;
++ }
++ return 0;
++}
++early_param("nosmt", smt_cmdline_disable);
++
++static inline bool cpu_smt_allowed(unsigned int cpu)
++{
++ return cpu_smt_control == CPU_SMT_ENABLED ||
++ topology_is_primary_thread(cpu);
++}
++#else
++static inline bool cpu_smt_allowed(unsigned int cpu) { return true; }
++#endif
++
+ /**
+ * notify_cpu_starting(cpu) - Invoke the callbacks on the starting CPU
+ * @cpu: cpu that just started
+@@ -1036,7 +1014,6 @@
+ enum cpuhp_state target = min((int)st->target, CPUHP_AP_ONLINE);
+
+ rcu_cpu_starting(cpu); /* Enables RCU usage on this CPU. */
+- st->booted_once = true;
+ while (st->state < target) {
+ st->state++;
+ cpuhp_invoke_callback(cpu, st->state, true, NULL);
+@@ -2137,6 +2114,5 @@
+ */
+ void __init boot_cpu_hotplug_init(void)
+ {
++ per_cpu_ptr(&cpuhp_state, smp_processor_id())->state = CPUHP_ONLINE;
+- this_cpu_write(cpuhp_state.booted_once, true);
+- this_cpu_write(cpuhp_state.state, CPUHP_ONLINE);
+ }
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002j.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002j.patch
new file mode 100644
index 0000000..b98ae77
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002j.patch
@@ -0,0 +1,239 @@
+--- b/arch/Kconfig
++++ a/arch/Kconfig
+@@ -5,9 +5,6 @@
+ config KEXEC_CORE
+ bool
+
+-config HOTPLUG_SMT
+- bool
+-
+ config OPROFILE
+ tristate "OProfile system profiling"
+ depends on PROFILING
+--- b/arch/x86/Kconfig
++++ a/arch/x86/Kconfig
+@@ -147,7 +147,6 @@
+ select HAVE_UID16 if X86_32 || IA32_EMULATION
+ select HAVE_UNSTABLE_SCHED_CLOCK
+ select HAVE_USER_RETURN_NOTIFIER
+- select HOTPLUG_SMT if SMP
+ select IRQ_FORCED_THREADING
+ select MODULES_USE_ELF_RELA if X86_64
+ select MODULES_USE_ELF_REL if X86_32
+--- b/include/linux/cpu.h
++++ a/include/linux/cpu.h
+@@ -257,17 +257,4 @@
+ static inline void cpuhp_report_idle_dead(void) { }
+ #endif /* #ifdef CONFIG_HOTPLUG_CPU */
+
+-enum cpuhp_smt_control {
+- CPU_SMT_ENABLED,
+- CPU_SMT_DISABLED,
+- CPU_SMT_FORCE_DISABLED,
+- CPU_SMT_NOT_SUPPORTED,
+-};
+-
+-#if defined(CONFIG_SMP) && defined(CONFIG_HOTPLUG_SMT)
+-extern enum cpuhp_smt_control cpu_smt_control;
+-#else
+-# define cpu_smt_control (CPU_SMT_ENABLED)
+-#endif
+-
+ #endif /* _LINUX_CPU_H_ */
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -978,29 +978,6 @@
+ EXPORT_SYMBOL(cpu_down);
+ #endif /*CONFIG_HOTPLUG_CPU*/
+
+-#ifdef CONFIG_HOTPLUG_SMT
+-enum cpuhp_smt_control cpu_smt_control __read_mostly = CPU_SMT_ENABLED;
+-
+-static int __init smt_cmdline_disable(char *str)
+-{
+- cpu_smt_control = CPU_SMT_DISABLED;
+- if (str && !strcmp(str, "force")) {
+- pr_info("SMT: Force disabled\n");
+- cpu_smt_control = CPU_SMT_FORCE_DISABLED;
+- }
+- return 0;
+-}
+-early_param("nosmt", smt_cmdline_disable);
+-
+-static inline bool cpu_smt_allowed(unsigned int cpu)
+-{
+- return cpu_smt_control == CPU_SMT_ENABLED ||
+- topology_is_primary_thread(cpu);
+-}
+-#else
+-static inline bool cpu_smt_allowed(unsigned int cpu) { return true; }
+-#endif
+-
+ /**
+ * notify_cpu_starting(cpu) - Invoke the callbacks on the starting CPU
+ * @cpu: cpu that just started
+@@ -1119,10 +1096,6 @@
+ err = -EBUSY;
+ goto out;
+ }
+- if (!cpu_smt_allowed(cpu)) {
+- err = -EPERM;
+- goto out;
+- }
+
+ err = _cpu_up(cpu, 0, target);
+ out:
+@@ -1869,153 +1842,10 @@
+ NULL
+ };
+
+-#ifdef CONFIG_HOTPLUG_SMT
+-
+-static const char *smt_states[] = {
+- [CPU_SMT_ENABLED] = "on",
+- [CPU_SMT_DISABLED] = "off",
+- [CPU_SMT_FORCE_DISABLED] = "forceoff",
+- [CPU_SMT_NOT_SUPPORTED] = "notsupported",
+-};
+-
+-static ssize_t
+-show_smt_control(struct device *dev, struct device_attribute *attr, char *buf)
+-{
+- return snprintf(buf, PAGE_SIZE - 2, "%s\n", smt_states[cpu_smt_control]);
+-}
+-
+-static void cpuhp_offline_cpu_device(unsigned int cpu)
+-{
+- struct device *dev = get_cpu_device(cpu);
+-
+- dev->offline = true;
+- /* Tell user space about the state change */
+- kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
+-}
+-
+-static int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
+-{
+- int cpu, ret = 0;
+-
+- cpu_maps_update_begin();
+- for_each_online_cpu(cpu) {
+- if (topology_is_primary_thread(cpu))
+- continue;
+- ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE);
+- if (ret)
+- break;
+- /*
+- * As this needs to hold the cpu maps lock it's impossible
+- * to call device_offline() because that ends up calling
+- * cpu_down() which takes cpu maps lock. cpu maps lock
+- * needs to be held as this might race against in kernel
+- * abusers of the hotplug machinery (thermal management).
+- *
+- * So nothing would update device:offline state. That would
+- * leave the sysfs entry stale and prevent onlining after
+- * smt control has been changed to 'off' again. This is
+- * called under the sysfs hotplug lock, so it is properly
+- * serialized against the regular offline usage.
+- */
+- cpuhp_offline_cpu_device(cpu);
+- }
+- if (!ret)
+- cpu_smt_control = ctrlval;
+- cpu_maps_update_done();
+- return ret;
+-}
+-
+-static void cpuhp_smt_enable(void)
+-{
+- cpu_maps_update_begin();
+- cpu_smt_control = CPU_SMT_ENABLED;
+- cpu_maps_update_done();
+-}
+-
+-static ssize_t
+-store_smt_control(struct device *dev, struct device_attribute *attr,
+- const char *buf, size_t count)
+-{
+- int ctrlval, ret;
+-
+- if (sysfs_streq(buf, "on"))
+- ctrlval = CPU_SMT_ENABLED;
+- else if (sysfs_streq(buf, "off"))
+- ctrlval = CPU_SMT_DISABLED;
+- else if (sysfs_streq(buf, "forceoff"))
+- ctrlval = CPU_SMT_FORCE_DISABLED;
+- else
+- return -EINVAL;
+-
+- if (cpu_smt_control == CPU_SMT_FORCE_DISABLED)
+- return -EPERM;
+-
+- if (cpu_smt_control == CPU_SMT_NOT_SUPPORTED)
+- return -ENODEV;
+-
+- ret = lock_device_hotplug_sysfs();
+- if (ret)
+- return ret;
+-
+- if (ctrlval != cpu_smt_control) {
+- switch (ctrlval) {
+- case CPU_SMT_ENABLED:
+- cpuhp_smt_enable();
+- break;
+- case CPU_SMT_DISABLED:
+- case CPU_SMT_FORCE_DISABLED:
+- ret = cpuhp_smt_disable(ctrlval);
+- break;
+- }
+- }
+-
+- unlock_device_hotplug();
+- return ret ? ret : count;
+-}
+-static DEVICE_ATTR(control, 0644, show_smt_control, store_smt_control);
+-
+-static ssize_t
+-show_smt_active(struct device *dev, struct device_attribute *attr, char *buf)
+-{
+- bool active = topology_max_smt_threads() > 1;
+-
+- return snprintf(buf, PAGE_SIZE - 2, "%d\n", active);
+-}
+-static DEVICE_ATTR(active, 0444, show_smt_active, NULL);
+-
+-static struct attribute *cpuhp_smt_attrs[] = {
+- &dev_attr_control.attr,
+- &dev_attr_active.attr,
+- NULL
+-};
+-
+-static const struct attribute_group cpuhp_smt_attr_group = {
+- .attrs = cpuhp_smt_attrs,
+- .name = "smt",
+- NULL
+-};
+-
+-static int __init cpu_smt_state_init(void)
+-{
+- if (!topology_smt_supported())
+- cpu_smt_control = CPU_SMT_NOT_SUPPORTED;
+-
+- return sysfs_create_group(&cpu_subsys.dev_root->kobj,
+- &cpuhp_smt_attr_group);
+-}
+-
+-#else
+-static inline int cpu_smt_state_init(void) { return 0; }
+-#endif
+-
+ static int __init cpuhp_sysfs_init(void)
+ {
+ int cpu, ret;
+
+- ret = cpu_smt_state_init();
+- if (ret)
+- return ret;
+-
+ ret = sysfs_create_group(&cpu_subsys.dev_root->kobj,
+ &cpuhp_cpu_root_attr_group);
+ if (ret)
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002k.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002k.patch
new file mode 100644
index 0000000..09c6527
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002k.patch
@@ -0,0 +1,31 @@
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -955,19 +955,20 @@
+ return ret;
+ }
+
+-static int cpu_down_maps_locked(unsigned int cpu, enum cpuhp_state target)
+-{
+- if (cpu_hotplug_disabled)
+- return -EBUSY;
+- return _cpu_down(cpu, 0, target);
+-}
+-
+ static int do_cpu_down(unsigned int cpu, enum cpuhp_state target)
+ {
+ int err;
+
+ cpu_maps_update_begin();
++
++ if (cpu_hotplug_disabled) {
++ err = -EBUSY;
++ goto out;
++ }
++
++ err = _cpu_down(cpu, 0, target);
++
++out:
+- err = cpu_down_maps_locked(cpu, target);
+ cpu_maps_update_done();
+ return err;
+ }
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002l.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002l.patch
new file mode 100644
index 0000000..1069057
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/002l.patch
@@ -0,0 +1,19 @@
+--- b/kernel/cpu.c
++++ a/kernel/cpu.c
+@@ -817,6 +817,7 @@
+
+ /* Park the smpboot threads */
+ kthread_park(per_cpu_ptr(&cpuhp_state, cpu)->thread);
++ smpboot_park_threads(cpu);
+
+ /*
+ * Prevent irq alloc/free while the dying cpu reorganizes the
+@@ -1388,7 +1389,7 @@
+ [CPUHP_AP_SMPBOOT_THREADS] = {
+ .name = "smpboot/threads:online",
+ .startup.single = smpboot_unpark_threads,
++ .teardown.single = NULL,
+- .teardown.single = smpboot_park_threads,
+ },
+ [CPUHP_AP_PERF_ONLINE] = {
+ .name = "perf:online",
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/003.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/003.patch
new file mode 100644
index 0000000..a385ea0
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/003.patch
@@ -0,0 +1,39 @@
+--- b/kernel/softirq.c
++++ a/kernel/softirq.c
+@@ -79,16 +79,12 @@
+
+ /*
+ * If ksoftirqd is scheduled, we do not want to process pending softirqs
++ * right now. Let ksoftirqd handle this at its own rate, to get fairness.
+- * right now. Let ksoftirqd handle this at its own rate, to get fairness,
+- * unless we're doing some of the synchronous softirqs.
+ */
++static bool ksoftirqd_running(void)
+-#define SOFTIRQ_NOW_MASK ((1 << HI_SOFTIRQ) | (1 << TASKLET_SOFTIRQ))
+-static bool ksoftirqd_running(unsigned long pending)
+ {
+ struct task_struct *tsk = __this_cpu_read(ksoftirqd);
+
+- if (pending & SOFTIRQ_NOW_MASK)
+- return false;
+ return tsk && (tsk->state == TASK_RUNNING);
+ }
+
+@@ -328,7 +324,7 @@
+
+ pending = local_softirq_pending();
+
++ if (pending && !ksoftirqd_running())
+- if (pending && !ksoftirqd_running(pending))
+ do_softirq_own_stack();
+
+ local_irq_restore(flags);
+@@ -355,7 +351,7 @@
+
+ static inline void invoke_softirq(void)
+ {
++ if (ksoftirqd_running())
+- if (ksoftirqd_running(local_softirq_pending()))
+ return;
+
+ if (!force_irqthreads) {
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/004.patch b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/004.patch
new file mode 100644
index 0000000..bc2c859
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/004.patch
@@ -0,0 +1,86 @@
+--- b/kernel/stop_machine.c
++++ a/kernel/stop_machine.c
+@@ -36,7 +36,7 @@
+ struct cpu_stopper {
+ struct task_struct *thread;
+
++ spinlock_t lock;
+- raw_spinlock_t lock;
+ bool enabled; /* is this stopper enabled? */
+ struct list_head works; /* list of pending works */
+
+@@ -78,13 +78,13 @@
+ unsigned long flags;
+ bool enabled;
+
++ spin_lock_irqsave(&stopper->lock, flags);
+- raw_spin_lock_irqsave(&stopper->lock, flags);
+ enabled = stopper->enabled;
+ if (enabled)
+ __cpu_stop_queue_work(stopper, work);
+ else if (work->done)
+ cpu_stop_signal_done(work->done);
++ spin_unlock_irqrestore(&stopper->lock, flags);
+- raw_spin_unlock_irqrestore(&stopper->lock, flags);
+
+ return enabled;
+ }
+@@ -231,8 +231,8 @@
+ struct cpu_stopper *stopper2 = per_cpu_ptr(&cpu_stopper, cpu2);
+ int err;
+ retry:
++ spin_lock_irq(&stopper1->lock);
++ spin_lock_nested(&stopper2->lock, SINGLE_DEPTH_NESTING);
+- raw_spin_lock_irq(&stopper1->lock);
+- raw_spin_lock_nested(&stopper2->lock, SINGLE_DEPTH_NESTING);
+
+ err = -ENOENT;
+ if (!stopper1->enabled || !stopper2->enabled)
+@@ -255,8 +255,8 @@
+ __cpu_stop_queue_work(stopper1, work1);
+ __cpu_stop_queue_work(stopper2, work2);
+ unlock:
++ spin_unlock(&stopper2->lock);
++ spin_unlock_irq(&stopper1->lock);
+- raw_spin_unlock(&stopper2->lock);
+- raw_spin_unlock_irq(&stopper1->lock);
+
+ if (unlikely(err == -EDEADLK)) {
+ while (stop_cpus_in_progress)
+@@ -448,9 +448,9 @@
+ unsigned long flags;
+ int run;
+
++ spin_lock_irqsave(&stopper->lock, flags);
+- raw_spin_lock_irqsave(&stopper->lock, flags);
+ run = !list_empty(&stopper->works);
++ spin_unlock_irqrestore(&stopper->lock, flags);
+- raw_spin_unlock_irqrestore(&stopper->lock, flags);
+ return run;
+ }
+
+@@ -461,13 +461,13 @@
+
+ repeat:
+ work = NULL;
++ spin_lock_irq(&stopper->lock);
+- raw_spin_lock_irq(&stopper->lock);
+ if (!list_empty(&stopper->works)) {
+ work = list_first_entry(&stopper->works,
+ struct cpu_stop_work, list);
+ list_del_init(&work->list);
+ }
++ spin_unlock_irq(&stopper->lock);
+- raw_spin_unlock_irq(&stopper->lock);
+
+ if (work) {
+ cpu_stop_fn_t fn = work->fn;
+@@ -541,7 +541,7 @@
+ for_each_possible_cpu(cpu) {
+ struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu);
+
++ spin_lock_init(&stopper->lock);
+- raw_spin_lock_init(&stopper->lock);
+ INIT_LIST_HEAD(&stopper->works);
+ }
+
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/apalis-imx6/defconfig b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/apalis-imx6/defconfig
index 5f6c0e4..5f6c0e4 100644
--- a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/apalis-imx6/defconfig
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/apalis-imx6/defconfig
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/colibri-imx6/defconfig b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/colibri-imx6/defconfig
index a3fdbf7..a3fdbf7 100644
--- a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/colibri-imx6/defconfig
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/colibri-imx6/defconfig
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/colibri-imx6ull/defconfig b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/colibri-imx6ull/defconfig
index 0d35162..0d35162 100644
--- a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/colibri-imx6ull/defconfig
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/colibri-imx6ull/defconfig
diff --git a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/mx7/defconfig b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/mx7/defconfig
index 068954a..82650f1 100644
--- a/recipes-kernel/linux/linux-toradex-rt-4.9-1.0.x/mx7/defconfig
+++ b/recipes-kernel/linux/linux-toradex-rt-4.9-2.3.x/mx7/defconfig
@@ -36,6 +36,7 @@ CONFIG_SOC_IMX7D=y
CONFIG_SMP=y
# CONFIG_ARM_CPU_TOPOLOGY is not set
CONFIG_VMSPLIT_2G=y
+CONFIG_ARM_PSCI=y
CONFIG_PREEMPT_RT_FULL=y
CONFIG_AEABI=y
CONFIG_CMA=y
diff --git a/recipes-kernel/linux/linux-toradex-rt_4.4.bb b/recipes-kernel/linux/linux-toradex-rt_4.4.bb
index 0c553cb..25e56e9 100644
--- a/recipes-kernel/linux/linux-toradex-rt_4.4.bb
+++ b/recipes-kernel/linux/linux-toradex-rt_4.4.bb
@@ -5,19 +5,19 @@ SUMMARY = "Linux kernel with real-time patch for Toradex Colibri VFxx Computer o
SRC_URI = " \
git://git.toradex.com/linux-toradex.git;protocol=git;branch=${SRCBRANCH} \
- https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/older/patches-4.4.157-rt174.tar.xz;name=rt-patch \
+ https://www.kernel.org/pub/linux/kernel/projects/rt/4.4/older/patch-4.4.164-rt176.patch.xz;name=rt-patch \
file://defconfig \
"
-SRC_URI[rt-patch.md5sum] = "d4ef18cb46b2ae2bbdcfd44756f3dff9"
-SRC_URI[rt-patch.sha256sum] = "24d36f61cc414050b53a25ee9d0ca0646f3e14847e093699a99c4102682c56dc"
+SRC_URI[rt-patch.md5sum] = "39d25cb2f119c9b4053ce1e40f2d00a8"
+SRC_URI[rt-patch.sha256sum] = "ecaaf3e329b4b4bf2b57c84344e3ae2ae8f0209ec40093ae6589decb48089b15"
KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget', ' libcomposite', '',d)}"
LOCALVERSION = "-${PR}"
PR = "${TDX_VER_ITEM}"
-SRCREV = "4f5df6df46d02b8fe23593461c003f689bd4dc4c"
+SRCREV = "09733c33a1e232097653c96bd788848129c95c7e"
SRCBRANCH = "toradex_vf_4.4"
SRCREV_use-head-next = "${AUTOREV}"
SRCBRANCH_use-head-next = "toradex_vf_4.4-next"
diff --git a/recipes-kernel/linux/linux-toradex-rt_4.9-1.0.x.bb b/recipes-kernel/linux/linux-toradex-rt_4.9-1.0.x.bb
deleted file mode 100644
index 0e3a6f0..0000000
--- a/recipes-kernel/linux/linux-toradex-rt_4.9-1.0.x.bb
+++ /dev/null
@@ -1,18 +0,0 @@
-require recipes-kernel/linux/linux-toradex_4.9-1.0.x.bb
-FILESEXTRAPATHS_prepend := "${THISDIR}/linux-toradex-rt-4.9-1.0.x:"
-
-SUMMARY = "Real-Time Linux kernel for Toradex Freescale i.MX based modules"
-
-SRC_URI += " \
- file://0001-Revert-timers-Forward-timer-base-before-migrating-ti.patch \
- https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patch-4.9.84-rt62.patch.xz;name=rt-patch \
- file://0003-timers-Forward-timer-base-before-migrating-timers.patch \
- file://0001-gpu-viv-enable-PREEMPT-RT-fixes.patch \
- file://0002-mm-Work-around-the-oops-below-by-disabling-split-ptl.patch \
-"
-
-SRC_URI[rt-patch.md5sum] = "c0c5e47f37c0b25dbab934c2a2e456bb"
-SRC_URI[rt-patch.sha256sum] = "399c873031599e356231fcf5694c7a438fb1f9faaa9bedcc0df4ef13fd8efc80"
-
-SRCREV = "3bb6e3284a1bb88f142528537e6573f9d9f39aaa"
-SRCBRANCH = "toradex_4.9-1.0.x-imx"
diff --git a/recipes-kernel/linux/linux-toradex-rt_4.9-2.3.x.bb b/recipes-kernel/linux/linux-toradex-rt_4.9-2.3.x.bb
new file mode 100644
index 0000000..87524a1
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-rt_4.9-2.3.x.bb
@@ -0,0 +1,31 @@
+require recipes-kernel/linux/linux-toradex_4.9-2.3.x.bb
+FILESEXTRAPATHS_prepend := "${THISDIR}/linux-toradex-rt-4.9-2.3.x:"
+
+SUMMARY = "Real-Time Linux kernel for Toradex Freescale i.MX based modules"
+
+SRC_URI += " \
+ file://001.patch \
+ file://001b.patch \
+ file://002.patch \
+ file://002b.patch \
+ file://002c.patch \
+ file://002d.patch \
+ file://002e.patch \
+ file://002f.patch \
+ file://002g.patch \
+ file://002h.patch \
+ file://002i.patch \
+ file://002j.patch \
+ file://002k.patch \
+ file://002l.patch \
+ file://003.patch \
+ file://004.patch \
+ https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patch-4.9.115-rt94.patch.xz;name=rt-patch \
+ file://0002-mm-Work-around-the-oops-below-by-disabling-split-ptl.patch \
+"
+
+SRC_URI[rt-patch.md5sum] = "7c19c496fe4b1e268f5f185b1b266043"
+SRC_URI[rt-patch.sha256sum] = "5d6ac2e1fe94dfea1ac0353bf1907653413bcbf6b795b833e4edf9586b79d68a"
+
+SRCREV = "5758a8e648a3947d974fbcaad49db6e513a77a9d"
+SRCBRANCH = "toradex_4.9-2.3.x-imx"
diff --git a/recipes-kernel/linux/linux-toradex_4.4.bbappend b/recipes-kernel/linux/linux-toradex_4.4.bbappend
index b562ed4..1d37124 100644
--- a/recipes-kernel/linux/linux-toradex_4.4.bbappend
+++ b/recipes-kernel/linux/linux-toradex_4.4.bbappend
@@ -4,7 +4,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/linux-toradex-4.4:"
LOCALVERSION = "-${TDX_VER_ITEM}"
-SRCREV = "4f5df6df46d02b8fe23593461c003f689bd4dc4c"
+SRCREV = "09733c33a1e232097653c96bd788848129c95c7e"
SRCBRANCH = "toradex_vf_4.4"
SRCREV_use-head-next = "${AUTOREV}"
SRCBRANCH_use-head-next = "toradex_vf_4.4-next"
diff --git a/recipes-kernel/linux/linux-toradex_4.9-1.0.x.bb b/recipes-kernel/linux/linux-toradex_4.9-2.3.x.bb
index d695bc3..8e46c9d 100644
--- a/recipes-kernel/linux/linux-toradex_4.9-1.0.x.bb
+++ b/recipes-kernel/linux/linux-toradex_4.9-2.3.x.bb
@@ -13,10 +13,10 @@ KERNEL_MODULE_AUTOLOAD += "${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget'
LOCALVERSION = "-${TDX_VER_ITEM}"
PV_append = "+git${SRCPV}"
-SRCREV = "3bb6e3284a1bb88f142528537e6573f9d9f39aaa"
-SRCBRANCH = "toradex_4.9-1.0.x-imx"
+SRCREV = "5758a8e648a3947d974fbcaad49db6e513a77a9d"
+SRCBRANCH = "toradex_4.9-2.3.x-imx"
SRCREV_use-head-next = "${AUTOREV}"
-SRCBRANCH_use-head-next = "toradex_4.9-1.0.x-imx-next"
+SRCBRANCH_use-head-next = "toradex_4.9-2.3.x-imx-next"
DEPENDS += "lzop-native bc-native"
COMPATIBLE_MACHINE = "(mx6|mx7)"