Realtime kernel for aarch64 Raspberry Pi3

Discussion about U-Boot and the kernel.

Realtime kernel for aarch64 Raspberry Pi3

Postby hifi25nl » Wed Jan 02, 2019 2:26 pm

I am trying to compile the 4.19.10 kernel for Raspberry Pi3 with real-time patch.
I have downloaded and extracted the 4.19.10 zip from https://github.com/archlinuxarm/PKGBUIL ... 3cd9b241e2
And the realtime patch from
https://mirrors.edge.kernel.org/pub/lin ... 8.patch.xz

After I have copied the folder linux-aarch64 to another directory and I have edited the PKGBUILD like this:

$this->bbcode_second_pass_code('', 'cd "${srcdir}/${_srcname}"

### Add rt patch
msg2 "Add rt patch"
patch -Np1 -i ../patch-4.19.10-rt8.patch

# add upstream patch
git apply --whitespace=nowarn ../patch-${pkgver}

...')

However I have always this error:
$this->bbcode_second_pass_code('', 'patching file security/apparmor/include/path.h
patching file security/apparmor/lsm.c
patching file virt/kvm/arm/arm.c
==> ERROR: A failure occurred in prepare().
Aborting...')

Tried to change "git apply" to "patch -Np1 -i ", but result is the same.

I don't think that the problem is real-time patch, since I have tried to apply it directly to source code without errors.

Any advice?
hifi25nl
 
Posts: 7
Joined: Fri Sep 07, 2018 9:02 am

Re: Realtime kernel for aarch64 Raspberry Pi3

Postby summers » Wed Jan 02, 2019 3:00 pm

I'd try running the commands one by one - then you can see which one is giving the problem ...

... oh yes - does the kernel need a patch for (close to) real time? I though there was progress a few years ago, that meant that it could be made close to real time, alas though its probably to complex to be actual real time ....
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Realtime kernel for aarch64 Raspberry Pi3

Postby hifi25nl » Thu Jan 03, 2019 11:26 am

Success!
I have applied prepare and build command manually, after I have made the package with a simplified PKGBUILD. All fine.
Strange that the original PKGBUILD was giving me some error in prepare. Maybe a hidden character...
hifi25nl
 
Posts: 7
Joined: Fri Sep 07, 2018 9:02 am

Re: Realtime kernel for aarch64 Raspberry Pi3

Postby hifi25nl » Sat Jan 05, 2019 5:06 pm

I have some CPU load because of this:
$this->bbcode_second_pass_code('', '
IRQs/Second
Device (IRQ) CPU0 CPU1 CPU2 CPU3 TOTAL
dwc2_hsotg:usb1 ( 41): 8083 0 0 0 8083')

Tried some additions to kernel line like
dwc2_hso.fiq_enable=0 dwc2_hso.fiq_fsm_enable=0 dwc2_hso.nak_holdoff=0

Without improvement.
hifi25nl
 
Posts: 7
Joined: Fri Sep 07, 2018 9:02 am

Re: Realtime kernel for aarch64 Raspberry Pi3

Postby summers » Sat Jan 05, 2019 5:56 pm

I know when I worked on a system that needed good timing (high end audio card that needed very rapid and regular interrupts responded to) that it looked much like that.

USB used to take a huge number of cycles in the kernel, and for something that had regular interrupts to be serviced just plugging in a USB device would cause lost interrupts.

What we did, is arrange for all USB interrupts to go to one CPU, and arrange all audio card interrupts to go to the other CPUs.

So what you have looks like that, (I can't recal how we set up interrupts directed to a single CPU but google is your friend). So my guess is your system has directed all USB interrupts to CPU 1. But what is your real time need? If that generates interrupts, can't you just arrange for these to go to CPU2-4 ?
summers
 
Posts: 995
Joined: Sat Sep 06, 2014 12:56 pm

Re: Realtime kernel for aarch64 Raspberry Pi3

Postby hifi25nl » Sat Jan 05, 2019 10:41 pm

This is an idea, but not a real solution.
What worry me is the CPU use:
$this->bbcode_second_pass_code('', ' 169 root -51 0 0 0 0 S 8.9 0.0 0:38.71 irq/41-dwc2_hso ')
This would not be avoided assigning the other audio processes to the other CPUs. Maybe it can solve dropouts in audio applications.
hifi25nl
 
Posts: 7
Joined: Fri Sep 07, 2018 9:02 am


Return to U-Boot/Kernel

Who is online

Users browsing this forum: No registered users and 10 guests