Odroid XU3/XU4 RT PREEMPT Linux support

Moderators: odroid, mdrjr

Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rohitgec » Wed Dec 16, 2015 11:55 pm

Dear All,

I want real-time support in linux kernel for SDR application (www.openairinterface.org) in order to run real-time LTE cellular stack on Odroid interfaced with SDR such as USRP (www.ettus.com) or BladeRF (www.nuand.com). So, I took the default kernel (odroidxu3-3.10.y) from the https://github.com/hardkernel/linux.git. and did following steps.

1. I patched the kernel with patch_3.10.93-rt101, https://www.kernel.org/pub/linux/kernel ... 1.patch.gz
2. Fixed the rejects and had to modify some files for conflicts. See my repository below and look at history for my exact changes.

So, now the basic RT Preempt support works, but when I turn on FULL PREEMPT RT, then there is this compilation error,

drivers/built-in.o: In function `drm_modeset_unlock':
drm_modeset_lock.c:(.text+0x7b534): undefined reference to `ww_mutex_unlock'
drivers/built-in.o: In function `drm_modeset_lock':
drm_modeset_lock.c:(.text+0x7b5d0): undefined reference to `__ww_mutex_lock'
drivers/built-in.o: In function `drm_modeset_lock_interruptible':
drm_modeset_lock.c:(.text+0x7b6e0): undefined reference to `__ww_mutex_lock_interruptible'
drivers/built-in.o: In function `modeset_backoff':
drm_modeset_lock.c:(.text+0x7b7d4): undefined reference to `__ww_mutex_lock_interruptible'
drm_modeset_lock.c:(.text+0x7b80c): undefined reference to `__ww_mutex_lock'
make: *** [vmlinux] Error 1

In order to solve the above problem, I tried to disable DRM support, but then my display was not working :( Can someone please help me modify this file so I can enable RT PREEMPT FULL support?

This will allow FULL PREEMPT RT kernel which will benefit other users of Odroid XU3/XU4 for other real-time applications.

For my application, we have to run complete LTE cellular stack (including LTE PHYsical layer on ARM) which is highly sensitive real-time application. So, I need full PREEMPT RT support.

There is git repository with my changes here, https://gitlab.eurecom.fr/oai/odroid-linux-3.10.y-rt (where RT PREEMPT basic works).

If anyone needs access to this repository to work with me, let me know and I can provide you access.
Regards,
Rohit
rohitgec
 
Posts: 8
Joined: Wed Dec 16, 2015 11:33 pm
languages_spoken: english
ODROIDs: XU3,XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby Brian.K » Fri Dec 18, 2015 12:02 pm

I just compiled this linux kernel source on your git repository. But, I could not find compile error on my environment as your report.

I used arm-none-eabi-gcc version 4.9.2.
Code: Select all
brian@brian-desktop:~/foo$ arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/opt/toolchains/arm-none-4.9/bin/../libexec/gcc/arm-none-eabi/4.9.2/lto-wrapper
Target: arm-none-eabi
Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-none-eabi-linux/.build/src/gcc-linaro-4.9-2014.09/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-none-eabi --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-none-eabi-linux/install --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-none-eabi-linux/install/arm-none-eabi --without-headers --with-newlib --enable-threads=no --disable-shared --with-pkgversion='crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --disable-__cxa_atexit --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-none-eabi-linux/.build/arm-none-eabi/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-none-eabi-linux/.build/arm-none-eabi/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-none-eabi-linux/.build/arm-none-eabi/build/static --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-none-eabi-linux/.build/arm-none-eabi/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-none-eabi-linux/.build/arm-none-eabi/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-none-eabi-linux/.build/arm-none-eabi/build/static --enable-lto --enable-linker-build-id --enable-libmudflap --disable-libgomp --enable-libssp --disable-libstdcxx-pch --enable-multilib --enable-languages=c,c++,fortran --with-multilib-list=aprofile
Thread model: single
gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09)


The build logs:
Code: Select all
brian@brian-desktop:~/linux-rt$ mv arch/arm/configs/odroidxu3_defconfig_rt_basic arch/arm/configs/odroidxu3_rt_defconfig
brian@brian-desktop:~/linux-rt$ make odroidxu3_rt_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#

#### make completed successfully (1 seconds) ####

brian@brian-desktop:~/linux-rt$ make -j8
               (......)
  H16TOFW firmware/edgeport/down2.fw
  IHEX    firmware/edgeport/down3.bin
  H16TOFW firmware/edgeport/down.fw
  IHEX2FW firmware/whiteheat_loader.fw
  IHEX2FW firmware/whiteheat.fw
  IHEX2FW firmware/keyspan_pda/keyspan_pda.fw
  IHEX2FW firmware/keyspan_pda/xircom_pgs.fw
  IHEX    firmware/cpia2/stv0672_vp4.bin

#### make completed successfully (04:12 (mm:ss)) ####

brian@brian-desktop:~/linux-rt$ find . -name 'drm_modeset_lock.o'
./drivers/gpu/drm/drm_modeset_lock.o
User avatar
Brian.K
 
Posts: 246
Joined: Tue Sep 15, 2015 7:30 pm
Location: South Korea
languages_spoken: English, Korean
ODROIDs: XU4, C1+, C2

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rohitgec » Sun Dec 20, 2015 9:21 pm

Hi Brian,

You need to select FULL PREEMPT RT support under the following options when you run make menuconfig:
Kernel Features -> Preemption Model (Full Preemptible Kernel (RT)
The odroid config file above (/odroidxu3_defconfig_rt_basic) uses Preemptible Kernel (RT Basic) and that compiles and also works fine. I tested it on my odroid XU3 board. However, when you select Full Preemptible Kernel (RT) option, then the compilation fails.

Let me know if it compiles for you. Then, I need to investigate more what is going on on my side.

Regards,
Rohit
rohitgec
 
Posts: 8
Joined: Wed Dec 16, 2015 11:33 pm
languages_spoken: english
ODROIDs: XU3,XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby Brian.K » Mon Dec 21, 2015 2:06 pm

I saw the error messages after Preemption Model was changed. (Basic RT -> Full Preemptible Kernel)

ww_mutex_* functions define 'kernel/mutex.c' file. Link
But, if we use Full Preemptible kernel feature, then 'kernel/mutex.c' does not compiled by Makefile. Link

I think ww_mutex_* functions should be changed to rt_mutex_* functions. (However, rt_mutex_* functions do not have acquire_ctx parameter.)
So you should modify correctly mutex_lock functions for the realtime feature.
User avatar
Brian.K
 
Posts: 246
Joined: Tue Sep 15, 2015 7:30 pm
Location: South Korea
languages_spoken: English, Korean
ODROIDs: XU4, C1+, C2

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rohitgec » Mon Dec 21, 2015 8:20 pm

Yes, thats what I thought. What do you think about reimplementing ww_mutex in rtmutex.c, but using rt_mutex_* functions to reimplement ww_mutex. I think this would be more cleaner. Also, I notice that drm_modeset_lock.c history says that "it is dropped from mainline linux kernel" (https://gitlab.eurecom.fr/oai/odroid-li ... set_lock.c). Can you please tell me which kernel version was used for drm drop?
I am no expert in linux kernel, but which approach you think is the best?
rohitgec
 
Posts: 8
Joined: Wed Dec 16, 2015 11:33 pm
languages_spoken: english
ODROIDs: XU3,XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby Brian.K » Tue Dec 22, 2015 7:04 pm

I think this code is helpful to solve this issue. ;-)
Link
User avatar
Brian.K
 
Posts: 246
Joined: Tue Sep 15, 2015 7:30 pm
Location: South Korea
languages_spoken: English, Korean
ODROIDs: XU4, C1+, C2

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rohitgec » Tue Dec 22, 2015 9:31 pm

Thanks Brian. I really appreciate your help. I will see how this works and let you know!
rohitgec
 
Posts: 8
Joined: Wed Dec 16, 2015 11:33 pm
languages_spoken: english
ODROIDs: XU3,XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rohitgec » Sun Jan 31, 2016 8:35 am

Hi Brian,

I tried your suggestion and created a new branch,
https://gitlab.eurecom.fr/oai/odroid-li ... pt_rt_full

However, now I get a kernel panic and Odroid XU4 completely freezes. Any help you can provide will be great!

I need higher kernel versions (3.17+) with lowlatency support for my application to work as it runs many threads with critical priorities while at the same time interacting with Software Defined Radio (SDR) connected over USB. Is there any planned support for Odroid XU4 to support kernels higher than 3.17+ ?

I also tried using kernel v4.2 (https://github.com/hardkernel/linux/tre ... 4-v4.2-rc1) from the main github but its quite unstable on Odroid XU4.
Regards,
Rohit
rohitgec
 
Posts: 8
Joined: Wed Dec 16, 2015 11:33 pm
languages_spoken: english
ODROIDs: XU3,XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rooted » Sun Jan 31, 2016 8:08 pm

rohitgec wrote:Hi Brian,

I tried your suggestion and created a new branch,
https://gitlab.eurecom.fr/oai/odroid-li ... pt_rt_full

However, now I get a kernel panic and Odroid XU4 completely freezes. Any help you can provide will be great!

I need higher kernel versions (3.17+) with lowlatency support for my application to work as it runs many threads with critical priorities while at the same time interacting with Software Defined Radio (SDR) connected over USB. Is there any planned support for Odroid XU4 to support kernels higher than 3.17+ ?

I also tried using kernel v4.2 (https://github.com/hardkernel/linux/tre ... 4-v4.2-rc1) from the main github but its quite unstable on Odroid XU4.
Regards,
Rohit

I'm running 4.4 without issue, what problem did you have with 4.2?
User avatar
rooted
 
Posts: 5905
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rohitgec » Mon Feb 01, 2016 2:40 am

I used 14.04 and compiled the above kernel 4.2 and then the odroid does not boot and has kernel panic. Sometimes, it boots but I see messages in dmesg which I think are errors from kernel.

Can you please send me the link to 4.4 kernel that is working for you? Maybe I should try it.

Regards,
Rohit
rohitgec
 
Posts: 8
Joined: Wed Dec 16, 2015 11:33 pm
languages_spoken: english
ODROIDs: XU3,XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rooted » Mon Feb 01, 2016 6:43 am

rohitgec wrote:I used 14.04 and compiled the above kernel 4.2 and then the odroid does not boot and has kernel panic. Sometimes, it boots but I see messages in dmesg which I think are errors from kernel.

Can you please send me the link to 4.4 kernel that is working for you? Maybe I should try it.

Regards,
Rohit

It's mainline, I'm now running 4.5-rc1

https://www.kernel.org/

You can see the instructions here, look for odroid-xu4 mainline at the bottom

https://github.com/umiddelb/armhf/wiki/ ... 4-mainline
User avatar
rooted
 
Posts: 5905
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rohitgec » Tue Feb 02, 2016 2:01 am

Hi,

So, I tried the mainline kernel v4.4 (https://github.com/umiddelb/armhf/wiki/ ... 4-mainline) from the link above and I when I boot the Odroid XU4, I see that the fan keeps running and nothing on display. I have tried this on Odroid 14.04, 15.04 image.

Do you think that I have HW revisions of Odroid XU4 that is causing the problem? How about the firmware version? I am using the default firmware that comes with the image.

I am just wondering what is different from yours and mine setup that could isolate this problem :)

Any ideas what is going on?

Regards,
Rohit
rohitgec
 
Posts: 8
Joined: Wed Dec 16, 2015 11:33 pm
languages_spoken: english
ODROIDs: XU3,XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rooted » Tue Feb 02, 2016 7:23 am

There is no display on mainline, the fan should not keep running.
User avatar
rooted
 
Posts: 5905
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby venkatbo » Tue Feb 02, 2016 9:36 am

Could out-of-control processes/threads peg the CPU/cores at ~100% requiring the fan to come on ?
User avatar
venkatbo
 
Posts: 472
Joined: Mon Feb 25, 2013 3:10 pm
Location: Bay Area, California
languages_spoken: english
ODROIDs: C0/C1+/C2 U3+ XU3-Lite/XU4 VU/VU7+ Touchscreen Show TFT Cloudshell SmartPower mAHRS DAC GPS Multiscope

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rooted » Tue Feb 02, 2016 12:11 pm

I assume something went wrong.
User avatar
rooted
 
Posts: 5905
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rohitgec » Tue Feb 02, 2016 7:26 pm

If there is no display on mainline, how do you see if something is working properly? Using a serial port?
rohitgec
 
Posts: 8
Joined: Wed Dec 16, 2015 11:33 pm
languages_spoken: english
ODROIDs: XU3,XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby odroid » Tue Feb 02, 2016 8:25 pm

The HDMI display works on the Kernel 4.4.
viewtopic.php?f=95&t=18034
But it seems to have some compatibility issue.

Yes, we've used a serial console for development.
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby rooted » Wed Feb 03, 2016 1:27 am

odroid wrote:The HDMI display works on the Kernel 4.4.
viewtopic.php?f=95&t=18034
But it seems to have some compatibility issue.

Yes, we've used a serial console for development.

I knew about that but I meant straight vanilla mainline has no HDMI.
User avatar
rooted
 
Posts: 5905
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby Siteks » Fri Apr 15, 2016 5:49 pm

I also needed hard realtime as provided by PREEMPT_RT_FULL. I used Rohits repo - https://gitlab.eurecom.fr/oai/odroid-linux-3.10.y-rt - and got the same errors with DRM enabled, due to no ww_ (wait/wound) type mutexs defined.

The way I fixed this was to take the vanilla 3.12.58 kernel and patch this with PREEMPT_RT patch-3.12.57-rt77.patch. This applies without error. Then copy kernel/rtmutex.c over the 3.10.y-rt version. The 3.12 version of the RT patch provides the missing ww_ mutexs within this file. The kernel now builds without error when DRM is enabled.

When running 3D accelerated rendering and a hard realtime thread talking to SPI, I now get reasonable latency results. Not brilliant, but certainly ok for my application and with no tuning yet.



sudo ./cyclictest -p80 -a -t -n -l100000
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 3.47 2.34 1.30 2/285 14521

T: 0 (12912) P:80 I:1000 C: 100000 Min: 26 Act: 53 Avg: 58 Max: 322
T: 1 (12913) P:80 I:1500 C: 66670 Min: 26 Act: 49 Avg: 57 Max: 257
T: 2 (12914) P:80 I:2000 C: 50002 Min: 28 Act: 54 Avg: 61 Max: 220
T: 3 (12915) P:80 I:2500 C: 40002 Min: 24 Act: 46 Avg: 60 Max: 586
T: 4 (12916) P:80 I:3000 C: 33334 Min: 44 Act: 59 Avg: 94 Max: 340
T: 5 (12917) P:80 I:3500 C: 28572 Min: 43 Act: 52 Avg: 95 Max: 361
T: 6 (12918) P:80 I:4000 C: 25001 Min: 48 Act: 69 Avg: 99 Max: 364
T: 7 (12919) P:80 I:4500 C: 22223 Min: 47 Act: 59 Avg: 100 Max: 334


Hope this is useful.


Simon
Siteks
 
Posts: 1
Joined: Fri Apr 15, 2016 5:32 pm
languages_spoken: english
ODROIDs: XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby giardino » Tue Jun 14, 2016 8:06 am

Hope this is useful.


That was HUGELY useful. I followed your changes exactly and I've booted 3.10.92-rt101 with PREEMPT RT on an ODROID XU4.

Thanks again for posting what works.
giardino
 
Posts: 2
Joined: Tue Jun 14, 2016 6:24 am
languages_spoken: english
ODROIDs: XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby HounD » Thu Sep 08, 2016 11:45 pm

If someone else needs RT PREEMPT Linux running on XU4 Odroid board fell free to clone master & build from here https://github.com/HounD/ODROID-XU4-RT-PREEMPT
HounD
 
Posts: 2
Joined: Thu Sep 08, 2016 11:38 pm
languages_spoken: english
ODROIDs: XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby sirjohndfox » Tue Nov 08, 2016 7:01 pm

Gday,

HounD, I'm trying to compile from your repository.

How should i configure it?

I did
Code: Select all
make odroidxu3_defconfig
make menuconfig (selecting full realtime....)
make zImage
make dtbs
make modules

However no .ko were produced so make modules_install fails
I tried

Code: Select all
make -C ./ modules


which fails
Code: Select all
 CC [M]  fs/aufs/i_op.o
fs/aufs/i_op.c: In function ‘au_pin_hdir_set_owner’:
fs/aufs/i_op.c:509:28: error: ‘struct mutex’ has no member named ‘owner’
  p->hdir->hi_inode->i_mutex.owner = task;
                            ^


I've not compiled a kernel in 10 years....
Could you help me out?

Cheers
John
sirjohndfox
 
Posts: 3
Joined: Sun Nov 06, 2016 5:39 pm
languages_spoken: english
ODROIDs: xu4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby sirjohndfox » Tue Nov 08, 2016 9:07 pm

it might be a problem with my build environment, i'm using jessie...i cant find a kbuild package for 3.10... i'm a bit confused. Is it also true that the network ports has problebs with this patch? Would any one be kind enough to make me a boot img? : but i need lan as i dont use a display...

Be very grateful for your help....
sirjohndfox
 
Posts: 3
Joined: Sun Nov 06, 2016 5:39 pm
languages_spoken: english
ODROIDs: xu4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby allanm84 » Tue Aug 15, 2017 5:34 am

Has anyone made progress on this? I attempted rubbing HounD's master branch but when running uname it doesn't list RT, just SMP PREEMPT. I explicitly enabled BASIC_RT in the kernel config. FULL_RT doesn't compile. Anyone who's had experience with this, I'd greatly appreciate your guidance.
allanm84
 
Posts: 6
Joined: Tue Aug 09, 2016 5:43 am
languages_spoken: english
ODROIDs: XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby gahabana » Thu Nov 23, 2017 8:18 pm

hi,
i've just tried to apply latest RT patches to 'next' branch

source: https://github.com/hardkernel/linux/tre ... dxu4-4.9.y
rt-patches: https://www.kernel.org/pub/linux/kernel ... ts/rt/4.9/

it compiles ok but it does not boot ... has anyone looked at what the issue might be ? i don't have serial debuigger yet, have ordered but need someone else with more brains to help out in the process ?

Thank you !!!
gahabana
 
Posts: 16
Joined: Wed Sep 07, 2016 1:47 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby gahabana » Fri Nov 24, 2017 7:30 am

gahabana wrote:hi,
i've just tried to apply latest RT patches to 'next' branch

source: https://github.com/hardkernel/linux/tre ... dxu4-4.9.y
rt-patches: https://www.kernel.org/pub/linux/kernel ... ts/rt/4.9/

it compiles ok but it does not boot ... has anyone looked at what the issue might be ? i don't have serial debuigger yet, have ordered but need someone else with more brains to help out in the process ?

Thank you !!!


Just to add - if one compiles kernel not as FULL_RT but rather BASIC - all works fine and latencies are fairly ok (max 250-400 micro seconds). But FULLRT would be awesome still !
gahabana
 
Posts: 16
Joined: Wed Sep 07, 2016 1:47 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby igorpec » Fri Nov 24, 2017 4:21 pm

ARMBIAN - follow on Twitter
linux for ARM development boards with user friendly development tools
User avatar
igorpec
 
Posts: 249
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, C2, C1+

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby gahabana » Fri Nov 24, 2017 9:04 pm

tried those @igorpec - same outcome.
btw, what i did compile on my own (and it compiles fine under Armbian) is latest rt61 patch ( https://www.kernel.org/pub/linux/kernel ... t61.tar.gz ) ... which is pretty much in sync with Armbian/Hardkernel code.
Hopefully you will make time to see what it would take to get that running on Odroid XU4 !
thank you !
gahabana
 
Posts: 16
Joined: Wed Sep 07, 2016 1:47 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby moon.linux » Sat Nov 25, 2017 4:23 pm

I just give the try with the latest HK 4.14.0 with the RT patch for patch-4.14.1-rt3.patch

On enable CONFIG_PREEMPT_RTB I was able to boot the kernel with disable of # CONFIG_HPERF_HMP is not set
as these leads to some compilation error.

I was not able to get the hold of why the kernel halts on enable CONFIG_PREEMPT_RT_FULL
It dose not give any pointer on where it failed to boot or any clue to look further.
Code: Select all
U-Boot 2017.05-15377-gedb23d4 (Aug 24 2017 - 07:09:51 -0300) for ODROID-XU4

CPU:   Exynos5422 @ 800 MHz
Model: Odroid XU4 based on EXYNOS5422
Board: Odroid XU4 based on EXYNOS5422
Type:  xu4
DRAM:  2 GiB
MMC:   EXYNOS DWMMC: 0, EXYNOS DWMMC: 1
MMC Device 0 ( SD ): 14.8 GiB
mmc_init: -5, time 4
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Press quickly 'Enter' twice to stop autoboot:  0
reading boot.ini
9493 bytes read in 18 ms (514.6 KiB/s)
cfgload: applying boot.ini...
cfgload: setenv initrd_high "0xffffffff"
cfgload: setenv fdt_high "0xffffffff"
cfgload: setenv macaddr "00:1e:06:61:7a:39"
cfgload: setenv vout "hdmi"
cfgload: setenv cecenable "false" # false or true
cfgload: setenv disable_vu7 "false" # false
cfgload: setenv governor "performance"
cfgload: setenv ddr_freq 825
cfgload: setenv external_watchdog "false"
cfgload: setenv external_watchdog_debounce "3"
cfgload: setenv HPD "true"
cfgload: setenv bootrootfs "console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0"
cfgload: fatload mmc 0:1 0x40008000 zImage
reading zImage
5790032 bytes read in 331 ms (16.7 MiB/s)
cfgload: fatload mmc 0:1 0x42000000 uInitrd
reading uInitrd
10306049 bytes read in 593 ms (16.6 MiB/s)
cfgload: if test "x${board_name}" = "x"; setenv board_name "xu4"; fi;
syntax error
syntax error
cfgload: if test "${board_name}" = "xu4"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4.dtb; setenv fdtloaded "true"; fi
reading exynos5422-odroidxu4.dtb
62739 bytes read in 12 ms (5 MiB/s)
cfgload: if test "${board_name}" = "xu3"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb; setenv fdtloaded "true"; fi
cfgload: if test "${board_name}" = "xu3l"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3-lite.dtb; setenv fdtloaded "true"; fi
cfgload: fdt addr 0x44000000
cfgload: setenv hdmi_phy_control "HPD=${HPD} vout=${vout}"
cfgload: if test "${cecenable}" = "false"; then fdt rm /cec@101B0000; fi
libfdt fdt_path_offset() returned FDT_ERR_NOTFOUND
cfgload: if test "${disable_vu7}" = "false"; then setenv hid_quirks "usbhid.quirks=0x0eef:0x0005:0x0004"; fi
cfgload: if test "${external_watchdog}" = "true"; then setenv external_watchdog "external_watchdog=${external_watchdog} external_watchdog_debounce=${external_watchdog_debounce}"; fi
cfgload: setenv bootargs "${bootrootfs} ${videoconfig} ${hdmi_phy_control} ${hid_quirks} smsc95xx.macaddr=${macaddr} ${external_watchdog} governor=${governor}"
cfgload: dmc ${ddr_freq}
cfgload: bootz 0x40008000 0x42000000 0x44000000
Kernel image @ 0x40008000 [ 0x000000 - 0x585950 ]
## Loading init Ramdisk from Legacy Image at 42000000 ...
   Image Name:   uInitrd-4.14.0-rt3-xu4krtf
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    10305985 Bytes = 9.8 MiB
   Load Address: 42000000
   Entry Point:  42000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 44000000
   Booting using the fdt blob at 0x44000000
   Using Device Tree in place at 44000000, end 44012512

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x100
[    0.000000] Linux version 4.14.0-rt3-xu4krtf (root@odroid) (gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.5)) #2 SMP PREEMPT RT Sat Nov 25 06:54:49 UTC 2017
[    0.000000] CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=30c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Hardkernel Odroid XU4
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 128 MiB at 0x00000000b6800000
[    0.000000] Samsung CPU ID: 0xe5422001
[    0.000000] Running under secure firmware.
[    0.000000] percpu: Embedded 18 pages/cpu @eed5e000 s43104 r8192 d22432 u73728
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 516928
[    0.000000] Kernel command line: console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0  HPD=true vout=hdmi usbhid.quirks=0x0eef:0x0005:0x0004 smsc95xx.macaddr=00:1e:06:61:7a:39 false governor=performance s5p_mfc.mem=16M
[    0.000000] hdmi: using HDMI mode
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1897600K/2074624K available (8192K kernel code, 694K rwdata, 2388K rodata, 2048K init, 361K bss, 45952K reserved, 131072K cma-reserved, 1157120K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xf0800000 - 0xff800000   ( 240 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0a00000   (10208 kB)
[    0.000000]       .init : 0xc0e00000 - 0xc1000000   (2048 kB)
[    0.000000]       .data : 0xc1000000 - 0xc10adba8   ( 695 kB)
[    0.000000]        .bss : 0xc10b5360 - 0xc110fab4   ( 362 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  No expedited grace period (rcu_normal_after_boot).
[    0.000000]  Tasks RCU enabled.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] Switching to timer-based delay loop, resolution 41ns
[    0.000000] clocksource: mct-frc: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000007] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000026] genirq: irq_chip COMBINER did not update eff. affinity mask of irq 49
[    0.001605] Console: colour dummy device 80x30
[    0.002348] console [tty1] enabled
[    0.002378] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=96000)
[    0.002389] pid_max: default: 32768 minimum: 301
[    0.002598] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.002615] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.003583] CPU: Testing write buffer coherency: ok
[    0.004500] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
[    0.020097] Setting up static identity map for 0x40200000 - 0x40200060
[    0.020780] ARM CCI driver probed
[    0.021022] Exynos MCPM support installed
[    0.036002] Hierarchical SRCU implementation.
[    0.068020] smp: Bringing up secondary CPUs ...
[    0.108408] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
[    0.148373] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
[    0.188380] CPU3: thread -1, cpu 3, socket 1, mpidr 80000103
[    0.228376] CPU4: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.268356] CPU5: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.308342] CPU6: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.348341] CPU7: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.348539] smp: Brought up 1 node, 8 CPUs
[    0.348698] SMP: Total of 8 processors activated (384.00 BogoMIPS).
[    0.348723] CPU: All CPU(s) started in HYP mode.
[    0.348743] CPU: Virtualization extensions available.
[    0.350472] devtmpfs: initialized
[    0.384539] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 3
[    0.385145] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.385200] futex hash table entries: 2048 (order: 5, 131072 bytes)
[    0.392496] pinctrl core: initialized pinctrl subsystem
[    0.396133] NET: Registered protocol family 16
[    0.402452] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.406110] cpuidle: using governor menu
[    0.407342] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.407386] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.419664] exynos-audss-clk 3810000.audss-clock-controller: epll 180633609
[    0.459152] EXYNOS5420 PMU initialized
[    0.518041] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.522595] SCSI subsystem initialized
[    0.523001] usbcore: registered new interface driver usbfs
[    0.523113] usbcore: registered new interface driver hub
[    0.523395] usbcore: registered new device driver usb
[    0.524399] i2c-gpio soc:i2c-hdmi: using pins 177 (SDA) and 178 (SCL)
[    0.525389] s3c-i2c 12c70000.i2c: slave address 0x00
[    0.525426] s3c-i2c 12c70000.i2c: bus frequency set to 378 KHz
[    0.526178] s3c-i2c 12c70000.i2c: i2c-1: S3C I2C adapter
[    0.527029] media: Linux media interface: v0.10
[    0.527115] Linux video capture interface: v2.00
[    0.527867] s3c2410-wdt 101d0000.watchdog: watchdog inactive, reset disabled, irq disabled
[    0.529460] Advanced Linux Sound Architecture Driver Initialized.
[    0.531703] clocksource: Switched to clocksource mct-frc
[    0.661732] VFS: Disk quotas dquot_6.6.0
[    0.661914] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.685325] NET: Registered protocol family 2
[    0.686539] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[    0.686710] TCP bind hash table entries: 8192 (order: 5, 229376 bytes)
[    0.687100] TCP: Hash tables configured (established 8192 bind 8192)
[    0.687517] UDP hash table entries: 512 (order: 3, 32768 bytes)
[    0.687611] UDP-Lite hash table entries: 512 (order: 3, 32768 bytes)
[    0.688332] NET: Registered protocol family 1
[    0.689587] RPC: Registered named UNIX socket transport module.
[    0.689621] RPC: Registered udp transport module.
[    0.689643] RPC: Registered tcp transport module.
[    0.689665] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.690100] Trying to unpack rootfs image as initramfs...
[    1.554891] Freeing initrd memory: 10068K
[    1.557239] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[    1.558717] hw perfevents: enabled with armv7_cortex_a15 PMU driver, 7 counters available
[    1.566463] audit: initializing netlink subsys (disabled)
[    1.566864] audit: type=2000 audit(1.560:1): state=initialized audit_enabled=0 res=1
[    1.568385] workingset: timestamp_bits=14 max_order=19 bucket_order=5
[    1.583332] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.585053] NFS: Registering the id_resolver key type
[    1.585171] Key type id_resolver registered
[    1.585195] Key type id_legacy registered
[    1.585237] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.585340] romfs: ROMFS MTD (C) 2007 Red Hat, Inc.
[    1.592350] bounce: pool size: 64 pages
[    1.592466] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    1.592789] io scheduler noop registered
[    1.592817] io scheduler deadline registered
[    1.593321] io scheduler cfq registered (default)
[    1.593350] io scheduler mq-deadline registered
[    1.593374] io scheduler kyber registered
[    1.597177] samsung-usb2-phy 12130000.phy: 12130000.phy supply vbus not found, using dummy regulator
[    1.599036] exynos5_usb3drd_phy 12100000.phy: 12100000.phy supply vbus not found, using dummy regulator
[    1.599208] exynos5_usb3drd_phy 12100000.phy: 12100000.phy supply vbus-boost not found, using dummy regulator
[    1.600006] exynos5_usb3drd_phy 12500000.phy: 12500000.phy supply vbus not found, using dummy regulator
[    1.600188] exynos5_usb3drd_phy 12500000.phy: 12500000.phy supply vbus-boost not found, using dummy regulator
[    1.610400] dma-pl330 3880000.adma: Loaded driver for PL330 DMAC-241330
[    1.610444] dma-pl330 3880000.adma:  DBUFF-4x8bytes Num_Chans-6 Num_Peri-16 Num_Events-6
[    1.616504] dma-pl330 121a0000.pdma: Loaded driver for PL330 DMAC-241330
[    1.616546] dma-pl330 121a0000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
[    1.622472] dma-pl330 121b0000.pdma: Loaded driver for PL330 DMAC-241330
[    1.622515] dma-pl330 121b0000.pdma:         DBUFF-32x4bytes Num_Chans-8 Num_Peri-32 Num_Events-32
[    1.624711] dma-pl330 10800000.mdma: Loaded driver for PL330 DMAC-241330
[    1.624750] dma-pl330 10800000.mdma:         DBUFF-64x8bytes Num_Chans-8 Num_Peri-1 Num_Events-32
[    1.742976] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    1.747082] 12c00000.serial: ttySAC0 at MMIO 0x12c00000 (irq = 58, base_baud = 0) is a S3C6400/10
[    1.747931] 12c10000.serial: ttySAC1 at MMIO 0x12c10000 (irq = 59, base_baud = 0) is a S3C6400/10
[    1.748619] 12c20000.serial: ttySAC2 at MMIO 0x12c20000 (irq = 60, base_baud = 0) is a S3C6400/10
[    2.611055] console [ttySAC2] enabled
[    2.615294] 12c30000.serial: ttySAC3 at MMIO 0x12c30000 (irq = 61, base_baud = 0) is a S3C6400/10
[    2.627253] exynos-mixer 14450000.mixer: Linked as a consumer to 14650000.sysmmu
[    2.633278] iommu: Adding device 14450000.mixer to group 0
[    2.641148] exynos-hdmi 14530000.hdmi: Failed to get supply 'vdd': -517
[    2.647521] exynos-drm-g2d 10850000.g2d: Linked as a consumer to 10a60000.sysmmu
[    2.653907] exynos-drm-g2d 10850000.g2d: Linked as a consumer to 10a70000.sysmmu
[    2.661137] iommu: Adding device 10850000.g2d to group 1
[    2.667170] exynos-drm-g2d 10850000.g2d: The Exynos G2D (ver 4.1) successfully probed.
[    2.676264] exynos-rot 11c00000.rotator: Linked as a consumer to 11d40000.sysmmu
[    2.682288] iommu: Adding device 11c00000.rotator to group 2
[    2.688383] exynos-rot 11c00000.rotator: The exynos rotator is probed successfully
[    2.696790] exynos-drm-ipp exynos-drm-ipp: drm ipp registered successfully.
[    2.709113] mali 11800000.mali: Continuing without Mali regulator control
[    2.716930] mali 11800000.mali: GPU identified as 0x0620 r0p1 status 0
[    2.722620] mali 11800000.mali: Protected mode not available
[    2.728500] devfreq devfreq0: Couldn't update frequency transition information.
[    2.735995] mali 11800000.mali: Probed as mali0
[    2.760075] brd: module loaded
[    2.787005] loop: module loaded
[    2.790291] libphy: Fixed MDIO Bus: probed
[    2.793569] usbcore: registered new interface driver r8152
[    2.798470] usbcore: registered new interface driver cdc_ether
[    2.804261] usbcore: registered new interface driver cdc_subset
[    2.813531] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.818628] ehci-exynos: EHCI EXYNOS driver
[    2.823230] exynos-ehci 12110000.usb: EHCI Host Controller
[    2.828255] exynos-ehci 12110000.usb: new USB bus registered, assigned bus number 1
[    2.836696] exynos-ehci 12110000.usb: irq 80, io mem 0x12110000
[    2.855782] exynos-ehci 12110000.usb: USB 2.0 started, EHCI 1.00
[    2.860758] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    2.867088] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    2.874281] usb usb1: Product: EHCI Host Controller
[    2.879127] usb usb1: Manufacturer: Linux 4.14.0-rt3-xu4krtf ehci_hcd
[    2.885542] usb usb1: SerialNumber: 12110000.usb
[    2.891264] hub 1-0:1.0: USB hub found
[    2.893909] hub 1-0:1.0: 3 ports detected
[    2.899587] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    2.904334] ohci-exynos: OHCI EXYNOS driver
[    2.908841] exynos-ohci 12120000.usb: USB Host Controller
[    2.913864] exynos-ohci 12120000.usb: new USB bus registered, assigned bus number 2
[    2.921991] exynos-ohci 12120000.usb: irq 80, io mem 0x12120000
[    2.988090] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[    2.993414] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.000607] usb usb2: Product: USB Host Controller
[    3.005365] usb usb2: Manufacturer: Linux 4.14.0-rt3-xu4krtf ohci_hcd
[    3.011780] usb usb2: SerialNumber: 12120000.usb
[    3.017439] hub 2-0:1.0: USB hub found
[    3.020144] hub 2-0:1.0: 3 ports detected
[    3.026875] usbcore: registered new interface driver usb-storage
[    3.032759] mousedev: PS/2 mouse device common for all mice
[    3.039616] i2c /dev entries driver
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby gahabana » Sat Nov 25, 2017 8:54 pm

hi @moon.linux,
yes - i have the same behavious with -next kernel (4.9.61) with latest rt61 patches.
If i select CONFIG_PREEMPT_RTB (Preemptible Kernel (Basic RT)) all is good and i don't need to change anything else - kernel/image builds fine and works fine. No need to deselect "HPERF_HMP load balancing enhancements for ARM big.LITTLE" .
But if i choose Fully Preemptible Kernel (PREEMPT_RT_FULL) - it builds fine but locks on boot - similar to what you have found with 4.14.1
gahabana
 
Posts: 16
Joined: Wed Sep 07, 2016 1:47 am
languages_spoken: english
ODROIDs: odroid-c2

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby moon.linux » Sat Nov 25, 2017 11:31 pm

@gahabana I feel some core locking happend when we switch to PREEMPT_RT_FULL,
but in my previous experience their is in a issue on preemption other than the default one,
need to raise this issue with the maintainers.
moon.linux
 
Posts: 1161
Joined: Thu Oct 02, 2014 11:42 pm
languages_spoken: english

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby tissue » Fri Dec 15, 2017 4:34 am

@Siteks or @giardino

After cloning Rohit's patched 3.10.93 kernel including rtmutex.c replacement, I can boot into the system, but it immediately crashes to frozen black screen after about 30 seconds.

I am attempting to run it on an XU4.

These are the steps I followed in the source folder:

Code: Select all
$ make odroidxu3_defconfig
$ make -j 8 zImage dtbs modules
$ make menuconfig
$ sudo cp arch/arm/boot/zImage arch/arm/boot/dts/*.dtb /media/boot
$ sudo make modules_install
$ sudo make firmware_install


The make menuconfig step was to set the kernel to full preempt. Do I need to replace the first line with an odroidxu4_defconfig file? Anything missing?
tissue
 
Posts: 2
Joined: Tue Dec 12, 2017 6:20 am
languages_spoken: english
ODROIDs: XU4

Re: Odroid XU3/XU4 RT PREEMPT Linux support

Unread postby ajcalderont » Sun Aug 26, 2018 1:56 am

Hi

Has anyone been able to compile a functional fully preemptable kernel for the ODROID XU4?

Thanks in advance!
ajcalderont
 
Posts: 1
Joined: Sun Aug 26, 2018 1:50 am
languages_spoken: english
ODROIDs: ODROID XU4


Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 1 guest