summaryrefslogtreecommitdiff
path: root/kernels/linux-libre-rt
diff options
context:
space:
mode:
Diffstat (limited to 'kernels/linux-libre-rt')
-rw-r--r--kernels/linux-libre-rt/PKGBUILD7
-rw-r--r--kernels/linux-libre-rt/revert_timers-dont_raise_softirq_unconditionally_and_fixes.patch130
2 files changed, 136 insertions, 1 deletions
diff --git a/kernels/linux-libre-rt/PKGBUILD b/kernels/linux-libre-rt/PKGBUILD
index c808bceb0..bce062b82 100644
--- a/kernels/linux-libre-rt/PKGBUILD
+++ b/kernels/linux-libre-rt/PKGBUILD
@@ -17,7 +17,7 @@ _releasever=10
_rtpatchver=rt7
_pkgver=${_basekernel}.${_releasever}
pkgver=${_basekernel}.${_releasever}_${_rtpatchver}
-pkgrel=1
+pkgrel=2
_lxopkgver=${_basekernel}.10 # nearly always the same as pkgver
arch=('i686' 'x86_64' 'mips64el')
url="https://rt.wiki.kernel.org/"
@@ -39,6 +39,7 @@ source=("http://linux-libre.fsfla.org/pub/linux-libre/releases/${_basekernel}-gn
'0002-module-allow-multiple-calls-to-MODULE_DEVICE_TABLE-p.patch'
'0003-module-remove-MODULE_GENERIC_TABLE.patch'
'0006-genksyms-fix-typeof-handling.patch'
+ 'revert_timers-dont_raise_softirq_unconditionally_and_fixes.patch'
"http://www.linux-libre.fsfla.org/pub/linux-libre/lemote/gnewsense/pool/debuginfo/linux-patches-${_lxopkgver}-gnu_0loongsonlibre_mipsel.tar.xz")
sha256sums=('477555c709b9407fe37dbd70d3331ff9dde1f9d874aba2741f138d07ae6f281b'
'4d6464017eba2219cad87733ee0f05e4b672762a09cb51079864e9d740305c06'
@@ -54,6 +55,7 @@ sha256sums=('477555c709b9407fe37dbd70d3331ff9dde1f9d874aba2741f138d07ae6f281b'
'52dec83a8805a8642d74d764494acda863e0aa23e3d249e80d4b457e20a3fd29'
'65d58f63215ee3c5f9c4fc6bce36fc5311a6c7dbdbe1ad29de40647b47ff9c0d'
'cf2e7a2d00787f754028e7459688c2755a406e632ce48b60952fa4ff7ed6f4b7'
+ 'b0107c64c582f7c6fa2e0c7c32a5f944c644f53b5df04667d487731b3c3b4060'
'727c9328414e0b18478144b700ddb9507269aff1af0130e04f091189efd4ccb8')
if [ "$CARCH" != "mips64el" ]; then
# don't use the Loongson-specific patches on non-mips64el arches.
@@ -74,6 +76,9 @@ prepare() {
# add realtime patch
patch -p1 -i "${srcdir}/patch-${_pkgver}-${_rtpatchver}.patch"
+ # revert a few troublesome patches
+ patch -p1 -i "${srcdir}/revert_timers-dont_raise_softirq_unconditionally_and_fixes.patch"
+
# add freedo as boot logo
patch -p1 -i "${srcdir}/boot-logo.patch"
diff --git a/kernels/linux-libre-rt/revert_timers-dont_raise_softirq_unconditionally_and_fixes.patch b/kernels/linux-libre-rt/revert_timers-dont_raise_softirq_unconditionally_and_fixes.patch
new file mode 100644
index 000000000..ffd42376a
--- /dev/null
+++ b/kernels/linux-libre-rt/revert_timers-dont_raise_softirq_unconditionally_and_fixes.patch
@@ -0,0 +1,130 @@
+diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
+index bdbf77db..79a7a35 100644
+--- a/include/linux/hrtimer.h
++++ b/include/linux/hrtimer.h
+@@ -461,8 +461,9 @@ extern int schedule_hrtimeout_range_clock(ktime_t *expires,
+ unsigned long delta, const enum hrtimer_mode mode, int clock);
+ extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode);
+
+-/* Called from the periodic timer tick */
++/* Soft interrupt function to run the hrtimer queues: */
+ extern void hrtimer_run_queues(void);
++extern void hrtimer_run_pending(void);
+
+ /* Bootup initialization: */
+ extern void __init hrtimers_init(void);
+diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
+index c19183d..c6d8232 100644
+--- a/kernel/hrtimer.c
++++ b/kernel/hrtimer.c
+@@ -1694,6 +1694,30 @@ static void run_hrtimer_softirq(struct softirq_action *h)
+ }
+
+ /*
++ * Called from timer softirq every jiffy, expire hrtimers:
++ *
++ * For HRT its the fall back code to run the softirq in the timer
++ * softirq context in case the hrtimer initialization failed or has
++ * not been done yet.
++ */
++void hrtimer_run_pending(void)
++{
++ if (hrtimer_hres_active())
++ return;
++
++ /*
++ * This _is_ ugly: We have to check in the softirq context,
++ * whether we can switch to highres and / or nohz mode. The
++ * clocksource switch happens in the timer interrupt with
++ * xtime_lock held. Notification from there only sets the
++ * check bit in the tick_oneshot code, otherwise we might
++ * deadlock vs. xtime_lock.
++ */
++ if (tick_check_oneshot_change(!hrtimer_is_hres_enabled()))
++ hrtimer_switch_to_hres();
++}
++
++/*
+ * Called from hardirq context every jiffy
+ */
+ void hrtimer_run_queues(void)
+@@ -1706,13 +1730,6 @@ void hrtimer_run_queues(void)
+ if (hrtimer_hres_active())
+ return;
+
+- /*
+- * Check whether we can switch to highres mode.
+- */
+- if (tick_check_oneshot_change(!hrtimer_is_hres_enabled())
+- && hrtimer_switch_to_hres())
+- return;
+-
+ for (index = 0; index < HRTIMER_MAX_CLOCK_BASES; index++) {
+ base = &cpu_base->clock_base[index];
+ if (!timerqueue_getnext(&base->active))
+diff --git a/kernel/timer.c b/kernel/timer.c
+index cc34e42..7c523a4 100644
+--- a/kernel/timer.c
++++ b/kernel/timer.c
+@@ -1443,6 +1443,8 @@
+ irq_work_run();
+ #endif
+
++ hrtimer_run_pending();
++
+ if (time_after_eq(jiffies, base->timer_jiffies))
+ __run_timers(base);
+ }
+@@ -1452,52 +1454,8 @@
+ */
+ void run_local_timers(void)
+ {
+- struct tvec_base *base = __this_cpu_read(tvec_bases);
+-
+ hrtimer_run_queues();
+- /*
+- * We can access this lockless as we are in the timer
+- * interrupt. If there are no timers queued, nothing to do in
+- * the timer softirq.
+- */
+-#ifdef CONFIG_PREEMPT_RT_FULL
+-
+-#ifndef CONFIG_SMP
+- /*
+- * The spin_do_trylock() later may fail as the lock may be hold before
+- * the interrupt arrived. The spin-lock debugging code will raise a
+- * warning if the try_lock fails on UP. Since this is only an
+- * optimization for the FULL_NO_HZ case (not to run the timer softirq on
+- * an nohz_full CPU) we don't really care and shedule the softirq.
+- */
+ raise_softirq(TIMER_SOFTIRQ);
+- return;
+-#endif
+-
+- /* On RT, irq work runs from softirq */
+- if (irq_work_needs_cpu()) {
+- raise_softirq(TIMER_SOFTIRQ);
+- return;
+- }
+-
+- if (!spin_do_trylock(&base->lock)) {
+- raise_softirq(TIMER_SOFTIRQ);
+- return;
+- }
+-#endif
+-
+- if (!base->active_timers)
+- goto out;
+-
+- /* Check whether the next pending timer has expired */
+- if (time_before_eq(base->next_timer, jiffies))
+- raise_softirq(TIMER_SOFTIRQ);
+-out:
+-#ifdef CONFIG_PREEMPT_RT_FULL
+- rt_spin_unlock_after_trylock_in_irq(&base->lock);
+-#endif
+- /* The ; ensures that gcc won't complain in the !RT case */
+- ;
+ }
+
+ #ifdef __ARCH_WANT_SYS_ALARM