summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0229-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 03:21:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-08 03:21:37 +0000
commit06343b27411344fc542f4f3a643f8441aa35252d (patch)
tree66aa45187c93c350bbdf7e6ae4467a70bf3a8f4c /debian/patches-rt/0229-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch
parentMerging upstream version 4.19.260. (diff)
downloadlinux-06343b27411344fc542f4f3a643f8441aa35252d.tar.xz
linux-06343b27411344fc542f4f3a643f8441aa35252d.zip
Adding debian version 4.19.260-1.debian/4.19.260-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0229-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch')
-rw-r--r--debian/patches-rt/0229-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch98
1 files changed, 98 insertions, 0 deletions
diff --git a/debian/patches-rt/0229-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch b/debian/patches-rt/0229-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch
new file mode 100644
index 000000000..357c70d07
--- /dev/null
+++ b/debian/patches-rt/0229-hotplug-duct-tape-RT-rwlock-usage-for-non-RT.patch
@@ -0,0 +1,98 @@
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Fri, 4 Aug 2017 18:31:00 +0200
+Subject: [PATCH 229/342] hotplug: duct-tape RT-rwlock usage for non-RT
+Origin: https://git.kernel.org/cgit/linux/kernel/git/rt/linux-stable-rt.git/commit?id=c925857dee98daf7eea5dd1e206a94a9d9cd72cf
+
+This type is only available on -RT. We need to craft something for
+non-RT. Since the only migrate_disable() user is -RT only, there is no
+damage.
+
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+---
+ kernel/cpu.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/kernel/cpu.c b/kernel/cpu.c
+index 56cb58fce84c..6ae5b18bf3a5 100644
+--- a/kernel/cpu.c
++++ b/kernel/cpu.c
+@@ -78,7 +78,7 @@ static DEFINE_PER_CPU(struct cpuhp_cpu_state, cpuhp_state) = {
+ .fail = CPUHP_INVALID,
+ };
+
+-#ifdef CONFIG_HOTPLUG_CPU
++#if defined(CONFIG_HOTPLUG_CPU) && defined(CONFIG_PREEMPT_RT_FULL)
+ static DEFINE_PER_CPU(struct rt_rw_lock, cpuhp_pin_lock) = \
+ __RWLOCK_RT_INITIALIZER(cpuhp_pin_lock);
+ #endif
+@@ -294,6 +294,7 @@ static int cpu_hotplug_disabled;
+ */
+ void pin_current_cpu(void)
+ {
++#ifdef CONFIG_PREEMPT_RT_FULL
+ struct rt_rw_lock *cpuhp_pin;
+ unsigned int cpu;
+ int ret;
+@@ -316,6 +317,7 @@ void pin_current_cpu(void)
+ goto again;
+ }
+ current->pinned_on_cpu = cpu;
++#endif
+ }
+
+ /**
+@@ -323,6 +325,7 @@ void pin_current_cpu(void)
+ */
+ void unpin_current_cpu(void)
+ {
++#ifdef CONFIG_PREEMPT_RT_FULL
+ struct rt_rw_lock *cpuhp_pin = this_cpu_ptr(&cpuhp_pin_lock);
+
+ if (WARN_ON(current->pinned_on_cpu != smp_processor_id()))
+@@ -330,6 +333,7 @@ void unpin_current_cpu(void)
+
+ current->pinned_on_cpu = -1;
+ __read_rt_unlock(cpuhp_pin);
++#endif
+ }
+
+ DEFINE_STATIC_PERCPU_RWSEM(cpu_hotplug_lock);
+@@ -954,7 +958,9 @@ static int take_cpu_down(void *_param)
+
+ static int takedown_cpu(unsigned int cpu)
+ {
++#ifdef CONFIG_PREEMPT_RT_FULL
+ struct rt_rw_lock *cpuhp_pin = per_cpu_ptr(&cpuhp_pin_lock, cpu);
++#endif
+ struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
+ int err;
+
+@@ -967,14 +973,18 @@ static int takedown_cpu(unsigned int cpu)
+ */
+ irq_lock_sparse();
+
++#ifdef CONFIG_PREEMPT_RT_FULL
+ __write_rt_lock(cpuhp_pin);
++#endif
+
+ /*
+ * So now all preempt/rcu users must observe !cpu_active().
+ */
+ err = stop_machine_cpuslocked(take_cpu_down, NULL, cpumask_of(cpu));
+ if (err) {
++#ifdef CONFIG_PREEMPT_RT_FULL
+ __write_rt_unlock(cpuhp_pin);
++#endif
+ /* CPU refused to die */
+ irq_unlock_sparse();
+ /* Unpark the hotplug thread so we can rollback there */
+@@ -993,7 +1003,9 @@ static int takedown_cpu(unsigned int cpu)
+ wait_for_ap_thread(st, false);
+ BUG_ON(st->state != CPUHP_AP_IDLE_DEAD);
+
++#ifdef CONFIG_PREEMPT_RT_FULL
+ __write_rt_unlock(cpuhp_pin);
++#endif
+ /* Interrupts are moved away from the dying cpu, reenable alloc/free */
+ irq_unlock_sparse();
+