Fedora IoT on KUNBUS Compact: Kernel OOPs

Topics about the Software of Revolution Pi
Post Reply
ffwali
Posts: 3
Joined: 14 Mar 2021, 21:27

Fedora IoT on KUNBUS Compact: Kernel OOPs

Post by ffwali »

We are trying to port Fedora-IoT 34 in Kunbus Compact. I started by flashing the KUNBUS compact with Fedora IoT 34 and added the custom .dts files from KUNBUS. right now, I want to access DIO’s using Fedora with a custom kernel(5.11). Since Fedora doesn't have PiControl natively, I read the below given article:
https://revolution.kunbus.com/tutorials ... rect=en_US

I found-out that Fedora doesn't have dac082s085 driver and therefore I didn't find iio:device corresponding to the DAC. I set up a host machine with Kernel 5.11 (Since Fedora-Iot 34 has 5.11.0 kernel) and compiled the RevPi kernel (from Git) for armv7hl. After solving couple of issues regarding vermagic and stuff, I am able to load kernel module. Initially, I got the below error:

[14586.398801] ti_dac082s085: Unknown symbol __stack_chk_guard (err -2)
[14586.399281] ti_dac082s085: Unknown symbol __stack_chk_fail (err -2)

After disabling STACK PROTECTOR in the kernel. Now I am getting the following error:
[ 712.552076] Unable to handle kernel paging request at virtual address 7e7b9f64
[ 712.552681] pgd = 8f6c4b5b
[ 712.552893] [7e7b9f64] *pgd=00000000

I also updated memory@0 in dtb file from:
reg = <0x00 0x00> to reg = <0x00 0x40000000>

But I am still getting the same error.

Below is the stripped "modinfo" output of the ti_dac082s085.ko module:
depends: industrialio
intree: Y
name: ti_dac082s085
vermagic: 5.11.0-156.fc34.armv7hl SMP mod_unload ARMv7 p2v8

Kunbus (with Fedora-IoT 34) "uname -a":
Linux fedora 5.11.0-156.fc34.armv7hl #1 SMP Wed Feb 17 09:24:49 UTC 2021 armv7l armv7l armv7l GNU/Linux

I am not sure if the above errors are related to any Kernel configuration or something related to Kunbus. How can I solve this?

P.S: industrialio driver (which is the dependency of ti_dac082s085.ko module is already loaded).
[root@fedora ~]# lsmod | grep industrialio
industrialio 77824 2 mcp320x,iio_mux
User avatar
p.rosenberger
Posts: 91
Joined: 03 Jul 2020, 11:07

Re: Fedora IoT on KUNBUS Compact: Kernel OOPs

Post by p.rosenberger »

Hi ffwali,

I'm a bit lost with your description. Are you trying to run modules from our source/kernel tree with your kernel? I would not recommend that. You will get the best experience when using our kernel. The source tree includes the kernel configuration arch/arm/configs/revpi-v7_defconfig. If you want you can also use picontrol, then I would recommend to use the https://github.com/RevolutionPi/kernelbakery.

Best Regards
Philipp
ffwali
Posts: 3
Joined: 14 Mar 2021, 21:27

Re: Fedora IoT on KUNBUS Compact: Kernel OOPs

Post by ffwali »

Thanks for your reply, Rev-PI current kernel is based on kernel-4.19 although its an LTS kernel but it is not maintained for Fedora / Fedora IoT 34 it requires at least kernel-longterm 5.4/5.10 so kernelbakery won't work.
Reference: https://copr.fedorainfracloud.org/coprs ... gterm-4.19

We tried to port modules from your kernel to the new 5.11 kernel. after that, we tried using piControl it didn't work. Now the problem is we see iio devices except for the ti_dac082s085. The other ADC drivers such as a driver for "ain_muxed" and "mcp320x" are loaded by-default in Fedora-Iot 34.
After compiling the ti-dac082s085 driver with 5.11.6 kernel, we are getting the below error:
[ 153.497191] Unable to handle kernel paging request at virtual address 7e94df34
[ 153.497558] pgd = 690369f6
[ 153.497692] [7e94df34] *pgd=00000000

This seems to be some memory-related issue due to which Kernel is not able to allocate memory when driver gets probed. I am getting the following message in kernel dmesg:
[ 67.994996] PC is at ftrace_cmp_ips+

I am not able to identify that from where the ftrace_cmp_ips function is called. Any help in this regard?
P.S. I have used correct dtb and have also used revpi*.dtbo overlays and also added their information in config.txt
User avatar
p.rosenberger
Posts: 91
Joined: 03 Jul 2020, 11:07

Re: Fedora IoT on KUNBUS Compact: Kernel OOPs

Post by p.rosenberger »

I don't really understand what exactly you are doing. The ti-dac082s085 in mainline since 4.15. So you don't need to port this to your kernel. We never tested picontrol with a newer kernel then 4.19.
ffwali
Posts: 3
Joined: 14 Mar 2021, 21:27

Re: Fedora IoT on KUNBUS Compact: Kernel OOPs

Post by ffwali »

What I am trying to do (in simple words) is that I want to insert ti-dac082 driver in Kunbus running Fedora-IoT 34 (with kernel 5.11.X). If you see Fedora, it does not have the ti-dac082 driver in it natively that's why I had to compile it on my own. I simply git-clone the Revpi-4.19 kernel in my Desktop PC (having the latest Feodra for a workstation with kernel 5.11.X) and compiled it there. After it compiled successfully, I tried to load it in Kunbus, after which it showed the above errors
User avatar
p.rosenberger
Posts: 91
Joined: 03 Jul 2020, 11:07

Re: Fedora IoT on KUNBUS Compact: Kernel OOPs

Post by p.rosenberger »

Sorry to tell you. But this is not how this works. Not even remotely.

I think you need to get someone with experience with Linux kernel development. As I told you the the ti-dac082s085 is mainline since 4.15. You need to recompile the fedora kernel to include the driver. Taking the driver from our tree will not solve your problem. But this kind of work is really out of the scope of this forum.

Best Regards
Philipp
Post Reply