about real time kernel patch

We want to do the real time kernel patch,and we found that in the path “kernel/kernel-4.4” ,there is a directory “rt-patches”.
Do I need to patch all patches in the “rt-patches”?
Or I just go to https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/4.4/older/ to get the “patch-4.4.38-rt49.patch.xz” ?

I have not tried to add this, but generally speaking (and thus could be generally wrong), the “patch 4.4.1” files were applied to a 4.4.1 kernel. The 4.4.102 patch files were applied to kernel 4.4.102, so on. If you are using a 4.4.38 kernel, then you’d want the patches at or before 4.4.38. The exception is if you are back porting from a newer kernel. In some cases that could make sense, but if for example the patch is to a feature which did not exist in 4.4.38, then it would not make sense.

Also note that some patches from an earlier kernel might have made their way into mainline. In that case applying the earlier patch to 4.4.38 would fail (you can’t add a patch which is already patched).

I am just guessing, but most likely you want to at least start with all patches prior to the 4.4.102 patches.

Thanks for your reply.
also thanks for kozyilmaz,I can get the real-time kernel.

 just do this:
cd kernel/kernel-4.4
     for i in rt-patches/*.patch; do patch -p1 < $i; done

but,there is no information about real-time driver programming,there are all real-time application programming.
Does anyone know how to write a kernel thread at a real-time kernel?

Hi XuXiang,

Did you succeeded in applying the patch without any rejection ?