guysoft / RealtimePi

An out-of-the-box raspebrrypi/raspbian distro with a realtime kernel
GNU General Public License v3.0
164 stars 25 forks source link

New raspberrypi kernel will not build against rt61 or rt60 #9

Closed guysoft closed 6 years ago

guysoft commented 6 years ago

When building:

KERNEL_COMMIT=a00afce9b4231c120c8b007d2c48018547d0156f
22:59:51 ++++ export REALTIMEPI_RTPATCH=https://www.kernel.org/pub/linux/kernel/projects/rt/4.9/older/patch-4.9.76-rt61.patch.xz
1 out of 28 hunks FAILED -- saving rejects to file kernel/time/hrtimer.c.rej
 1 out of 45 hunks FAILED -- saving rejects to file kernel/workqueue.c.rej
guysoft commented 6 years ago

Blocks #8

guysoft commented 6 years ago

These are the commits that break the patching: https://github.com/raspberrypi/linux/commit/c98ff7299b404f110167883695f81080723e6e15 https://github.com/raspberrypi/linux/commit/ca2d736867200b931ca61383af2fd68bb5fd2ecb

--- kernel/time/hrtimer.c
+++ kernel/time/hrtimer.c
@@ -1824,16 +2040,20 @@ int hrtimers_prepare_cpu(unsigned int cpu)
        for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
                cpu_base->clock_base[i].cpu_base = cpu_base;
                timerqueue_init_head(&cpu_base->clock_base[i].active);
+               INIT_LIST_HEAD(&cpu_base->clock_base[i].expired);
        }

        cpu_base->cpu = cpu;
        hrtimer_init_hres(cpu_base);
+#ifdef CONFIG_PREEMPT_RT_BASE
+       init_waitqueue_head(&cpu_base->wait);
+#endif
        return 0;
 }

 #ifdef CONFIG_HOTPLUG_CPU

-static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
+static int migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
                                struct hrtimer_clock_base *new_base)
 {
        struct hrtimer *timer;
--- kernel/workqueue.c
+++ kernel/workqueue.c
@@ -48,6 +48,8 @@
 #include <linux/nodemask.h>
 #include <linux/moduleparam.h>
 #include <linux/uaccess.h>
+#include <linux/locallock.h>
+#include <linux/delay.h>

 #include "workqueue_internal.h"
guysoft commented 6 years ago

With patch-4.9.84-rt62 different code fails:

cat ./kernel/time/posix-timers.c.rej
--- kernel/time/posix-timers.c
+++ kernel/time/posix-timers.c
@@ -517,6 +517,9 @@ static struct pid *good_sigevent(sigevent_t * event)
        case SIGEV_THREAD:
                if (event->sigev_signo <= 0 || event->sigev_signo > SIGRTMAX)
                        return NULL;
+               if (sig_kernel_only(event->sigev_signo) ||
+                   sig_kernel_coredump(event->sigev_signo))
+                       return NULL;
                /* FALLTHRU */
        case SIGEV_NONE:
                return task_pid(rtn);
cat ./arch/x86/include/asm/thread_info.h.rej
--- arch/x86/include/asm/thread_info.h
+++ arch/x86/include/asm/thread_info.h
@@ -54,12 +54,15 @@ struct task_struct;

 struct thread_info {
        unsigned long           flags;          /* low level flags */
+       int                     preempt_lazy_count;     /* 0 => lazy preemptable
+                                                          <0 => BUG */
        u32                     status;         /* thread synchronous flags */
 };

 #define INIT_THREAD_INFO(tsk)                  \
 {                                              \
        .flags          = 0,                    \
+       .preempt_lazy_count = 0,                \
 }

 #define init_stack             (init_thread_union.stack)
guysoft commented 6 years ago

Fixed