cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
simon.beaudoin
Adventurer
Adventurer
4,030 Views
Registered: ‎05-08-2018

Can't find /dev/rpmsg_ctrl0

Hi, 

I am using the 2018.2 version of xilinx tools. 

I'm perfectly able to run all 3 OpenAMP exemples. I'm building on top of the proxy exemple. I want to create a dedicated endpoint for specific messages. On linux, when I try to create an endpoint, I can't seem to find the file "/dev/rpmsg_ctrl0" that seems to be the control file on which we must do an ioctl : 

int rpmsg_create_ept(int rpfd, struct rpmsg_endpoint_info *eptinfo)
{
	int ret;

	ret = ioctl(rpfd, RPMSG_CREATE_EPT_IOCTL, eptinfo);
	if (ret)
		perror("Failed to create endpoint.\n");
	return ret;
}

In the "echo_user.c" exemple (2018.2 on github) the code opens the file "/dev/rpmsg0", which I do see in /dev after I load rpmsg_user_dev_driver module. 

 

Correct me if I'm wrong, but this last file seems to be the default endpoint. Further in the exemple, it looks if the user specified a file with "rpmsg_ctrl" string" and then create the endpoint from it.

 

I don't see this "/dev/rpmsg_ctrl0" file. It seems to be created by the rpmsg_char driver, which appears loaded : 

 

root@U96_OHSim-Petalinux-2018:~# lsmod
    Tainted: G  
rpmsg_user_dev_driver 16384 0 - Live 0xffffff8000aed000 (O)
virtio_rpmsg_bus 20480 0 - Live 0xffffff8000ae3000
rpmsg_char 16384 0 - Live 0xffffff8000adb000
rpmsg_core 16384 3 rpmsg_user_dev_driver,virtio_rpmsg_bus,rpmsg_char, Live 0xffffff8000ad2000
zynqmp_r5_remoteproc 16384 0 - Live 0xffffff8000ab7000
uio_pdrv_genirq 16384 0 - Live 0xffffff8000a40000

If someone can enlight me on how to create multiple endpoints in linux userspace, I'd be very gratefull!!

0 Kudos
17 Replies
jovitac
Moderator
Moderator
3,970 Views
Registered: ‎05-10-2017

We have not moved to use the rpmsg_char driver. Our demos still use the rpmsg_user_dev_driver. We will move to this in 2019.1

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
simon.beaudoin
Adventurer
Adventurer
3,963 Views
Registered: ‎05-08-2018

Hi! Thanks for the reply. 

That's what I figured out too. In the mean time, regardless of what is done in the examples, is it normal that when I "modprobe rpmsg_char" nothing happens? I mean, it looks to me like this driver is part of mainline and not only Xilinx linux kernel fork

0 Kudos
jovitac
Moderator
Moderator
3,920 Views
Registered: ‎05-10-2017

Our master branch has examples of creating an endpoint

See rpmsg_create_ept_dev in https://github.com/OpenAMP/meta-openamp/blob/964a3a70478bc4d20a1af341434a894d592a692e/recipes-openamp/rpmsg-examples/rpmsg-proxy-app/proxy_app.c

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
simon.beaudoin
Adventurer
Adventurer
3,907 Views
Registered: ‎05-08-2018

Thanks for the reply! But that's the thing, the file /dev/rpmsg_ctrl0 is never created upon modprobing rpmsg_char. 

Nevertheless, we moved away from openamp and rpmsg and developped our own IPI com between APU <-> RPUs

0 Kudos
ngiai
Visitor
Visitor
3,146 Views
Registered: ‎12-14-2018

Hi,

It is 2020 but I'm still using 2018.1 :(

I came across the same problem. What I finally did to make it run was this:

cp ${PETALINUX}/components/yocto/source/aarch64/layers/meta-openamp/recipes-kernel/linux/config/001-rpmsg-virtio-rpmsg-Add-RPMsg-char-driver-support.patch  project-spec/meta-user/recipes-kernel/linux/linux-xlnx

cp ${PETALINUX}/components/yocto/source/aarch64/layers/meta-openamp/recipes-kernel/linux/config/openamp-experiment-virtio-rpmsg-char.cfg  project-spec/meta-user/recipes-kernel/linux/linux-xlnx

cp ${PETALINUX}/components/yocto/source/aarch64/layers/meta-openamp/recipes-kernel/linux/config/openamp.cfg  project-spec/meta-user/recipes-kernel/linux/linux-xlnx

Then, edit project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend this way:

SRC_URI += "file://0001-rpmsg-virtio-rpmsg-Add-RPMsg-char-driver-support.patch \
            file://openamp-experiment-virtio-rpmsg-char.cfg \
            file://openamp.cfg"

Build your project. Now you will see the '/dev/rpmsg_ctrl0' after 'modprobe rpmsg_char'.

 

The short answer is this: The patch enabling RPMsg OpenAMP demos using rpmsg char driver is not yet in upstream.

 

Salute!

0 Kudos
simon.beaudoin
Adventurer
Adventurer
3,122 Views
Registered: ‎05-08-2018

Hi, thanks for your sharing!

We ended up developping our own custom lightweight protocol for IPI instead of using openamp because of the limitation you brought up

0 Kudos
2,570 Views
Registered: ‎01-10-2020

Hi Simon,

I am working on xilinx project and this is my first experience with xiling and Linux.

I need to send to send data from RPU to APU cyclically. I tried to modify the Echotest Demo project of OpenAMP to make it run cyclically. but I am getting some segmentation Faults on the linux side (after receiving 240720 Bytes). 
Could you please share some more information about the IPI the you have developped. How did you implement it and if it's supporting cyclical APU-RPU communication ? I would be really grateful.

Thanks in advance

0 Kudos
simon.beaudoin
Adventurer
Adventurer
2,547 Views
Registered: ‎05-08-2018

Hi Iheb!

Can you elaborate a bit more on your issue?

Can you send the content of the console, the abort? like dmesg

The IPI solution we (me, for my company) developped is custom, we totally ditched OpenAMP completely. Maybe I could ask if we can disclose/sell only this portion and support for it. 

What I can say about it is that it works flawlessly, and it is very simple conceptually and to use. 

0 Kudos
simon.beaudoin
Adventurer
Adventurer
2,530 Views
Registered: ‎05-08-2018

As for your request for more information about our IPI solution : 

The IPI peripheral is a hard block in the PS, so anybody can write software that use it. OpenAMP use it, just like we do, but we found OpenAMP to be big, clunky and non intuitive to use. What we have is a custom kernel module, an extra device-tree node to provide information and load the driver at bootup, and finally a .c/.h module that is the equivalent of the kernel module but for RPU part.

The interface is pretty simple : The kernel module exposes a #definable number of endpoint files in/dev : 

/dev/IPI_EP0

/dev/IPI_EP1

and so on. The RPU side has to be compiled with the same define, to expose the same number of endpoints. At this point, to send a message to the RPU is simply a matter of writing to the opened enpoint file in userspace. To receive a message, spawn a thread that reads the file. It will block until a message is received and put the content of the received message in the passed buffer. 

 

At the RPU side, the user inits the IPI module with a desired task priority for the receive task (the one that processes the received message, basically executing the callback) and the keep alive task (a task which is responsible for trying to recover the link, never used in practice when everything goes well) : 

    void IPI_Init(u32 ProcessTaskPriority, u32 KeepAliveTaskPriority);

The user provides a callback for each desired endpoint :

    void IPI_SetEndpointCallback(IPI_DIRECTION_t direction, uint32_t endpoint_number, IPI_Callback_t callback);

Then, you can write messages as you want to any endpoint. That's thread-safe :

    s32 IPI_Write(IPI_DIRECTION_t direction, uint32_t endpoint_number, const char *buffer, u32 size);

The magic happens in the back. 

We implemented endpoints in order to have several logical pipes going through the one hardware 'link'. 

The user has to reserve some shared memory to make this all work. Say for APU <-> RPU0, you have one rx buffer and one tx buffer. They have to be placed in the device-tree node and #defined in the RPU code. 

In our project, I completed the port of FreeRTOS+MPU, inexistant for the CortexR5, so we use that in order to put some memory attributes to the buffers (non-executable, shared non-cachable, etc) so cache coherency in the RPU is taken care of. (Even tho you can use the standalone functions from xilinx to achieve coherency) 

Lastly, If by cyclical you mean sending a payload at a fixed (or not) interval, then yes it does that. Please, otherwise clarify what you mean by it.

Hope it's not too much details

0 Kudos
2,477 Views
Registered: ‎01-10-2020

Thanks for your reply,

for our project we want to send data packets from RPU to APU cyclically. For that I am using OpenAMP. I tried to modify the echotest demo project of openamp to get a proper cyclical RPU-APU data exchange. In the original echotest project data are being sent from APU to RPU. Then RPU receives this data and sends them back to the APU. And this is done for 472 packets (each packet contains 472 bytes). In our project I tried to just prepare packets on the RPU (472 bytes per packet) and send them to the RPU (one packet per 10ms). The problem is that after sending 510 Packets I get a segmentation fault on the APU linux side. And since the RPU is still sending packets, the vitio_rpmsg_bus linux driver shows the following error: virtio_rpmsg_bus virtio0: msg received with no recipient.

I guess am getting this segmentation fault because the rpmsg_char driver is writing the received buffers on the reading queue of the rpmsg device on the Linux side. But after 510 packets, the receiving buffer is full and linux gets a segmentation fault since the rpmsg_char driver is trying to enqueue the received packets in a memory adress which is out of his memory region. 

I can't understand why is that happening because the RPU is sending a packet every 10 ms and the APU is reading a packet every 470us (so reading is much faster than writing). And when a packet is read from the reading buffer of the rpmsg device then it should be dequeued. So when the RPU wants to send a new packet, the queue should be already free and it's offset is set on zero. So it doesn't make sense that the receiving buffer is getting full and that we are getting a segmentation fault.

do you have please any idea how can I avoid this segmentation fault ?

BR

Iheb

0 Kudos
simon.beaudoin
Adventurer
Adventurer
2,457 Views
Registered: ‎05-08-2018

Ho dear... This brings me back memories of the time we were trying to make interprocessor communication between APU <-> PRU0 <-> RPU1. 

It might not be exactly what you are describing nor the answer you are looking for, but still I'm gonna share with you an issue we had.

My first question is where are your shared buffers? I mean, the addresses? I Ask that because you might not be aware of it, but the APU relies upon a piece of software called the ATF, which among other things, offers smc calls for linux to play with the IPI registers. That piece of code, the ATF, is compiled by petalinux and bundled in the BOOT.BIN and placed in memory somewhere by the FSBL (or is it done by the CSU? I don't remember the boot order, I digress..). The default location for the ATF is in the top memory of the OCM. At the time, we didn't know and decided to split the whole OCM in 4 equal buffers. When the 4th buffer was beginning to fill, the RPU writing to it would override the ATF, which the linux driver needed to trap to in order to read the IPI registers, thus hanging the system completely. 

My second question is, is your segfault in userspace of in the kernel driver? can you provide the info at the end of the output of dmesg so I can check ?

Don't necessarly think of the buffer in term of being full or not, but in term of being used or not. With circular buffers, the head and tail pointers move forward and chase one another, to you can be writing at the end addresses of the buffer and still the buffer is close to being empty. Please provide as much info as possible, like your device tree patch and stuff like that. It's been forever since I plunged in openamp stuff

 

0 Kudos
2,399 Views
Registered: ‎01-10-2020

Hi Simon

Thanks for the reply. I added my device tree files and the c code of my Linux Application in the attatchements. In my application I added a segmentation-fault handler in order to know where is this fault happening. It shows that the segmentation fault is always happening in the adress: 0x74. And I'm getting the following error too: 

sh: redirection error: cannot duplicate fd: Too many open files
sh: /sys/class/remoteproc/remoteproc0/state: Too many open files

here is the output of dmesg at the end after getting the segmentation Fault:


[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 4.19.0-xilinx-v2019.2 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Mon Jul 13 13:27:22 UTC 2020
[ 0.000000] Machine model: xlnx,zynqmp
[ 0.000000] earlycon: cdns0 at MMIO 0x00000000ff000000 (options '115200n8')
[ 0.000000] bootconsole [cdns0] enabled
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] Reserved memory: created DMA memory pool at 0x000000003ed40000, size 1 MiB
[ 0.000000] OF: reserved mem: initialized node rproc@3ed400000, compatible id shared-dma-pool
[ 0.000000] cma: Reserved 256 MiB at 0x0000000065800000
[ 0.000000] On node 0 totalpages: 1048256
[ 0.000000] DMA32 zone: 7164 pages used for memmap
[ 0.000000] DMA32 zone: 0 pages reserved
[ 0.000000] DMA32 zone: 523968 pages, LIFO batch:63
[ 0.000000] Normal zone: 7168 pages used for memmap
[ 0.000000] Normal zone: 524288 pages, LIFO batch:63
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.1 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] psci: SMC Calling Convention v1.1
[ 0.000000] random: get_random_bytes called from start_kernel+0x94/0x3f8 with crng_init=0
[ 0.000000] percpu: Embedded 23 pages/cpu @(____ptrval____) s53656 r8192 d32360 u94208
[ 0.000000] pcpu-alloc: s53656 r8192 d32360 u94208 alloc=23*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
[ 0.000000] Speculative Store Bypass Disable mitigation not required
[ 0.000000] CPU features: detected: Kernel page table isolation (KPTI)
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 1033924
[ 0.000000] Kernel command line: earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk1p2 rw rootwait
[ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)
[ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)
[ 0.000000] software IO TLB: mapped [mem 0x7bfff000-0x7ffff000] (64MB)
[ 0.000000] Memory: 3729212K/4193024K available (10748K kernel code, 634K rwdata, 5424K rodata, 832K init, 314K bss, 201668K reserved, 262144K cma-reserved)
[ 0.000000] rcu: Hierarchical RCU implementation.
[ 0.000000] rcu: RCU event tracing is enabled.
[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[ 0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[ 0.000000] GIC: Adjusting CPU interface base to 0x00000000f902f000
[ 0.000000] GIC: Using split EOI/Deactivate mode
[ 0.000000] arch_timer: cp15 timer(s) running at 33.33MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x7b00c47c0, max_idle_ns: 440795202120 ns
[ 0.000003] sched_clock: 56 bits at 33MHz, resolution 30ns, wraps every 2199023255541ns
[ 0.008240] Console: colour dummy device 80x25
[ 0.012393] Calibrating delay loop (skipped), value calculated using timer frequency.. 66.66 BogoMIPS (lpj=133333)
[ 0.022668] pid_max: default: 32768 minimum: 301
[ 0.027372] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.033923] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.041749] ASID allocator initialised with 32768 entries
[ 0.046424] rcu: Hierarchical SRCU implementation.
[ 0.051435] EFI services will not be available.
[ 0.055749] smp: Bringing up secondary CPUs ...
[ 0.060421] Detected VIPT I-cache on CPU1
[ 0.060452] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 0.060787] Detected VIPT I-cache on CPU2
[ 0.060808] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 0.061122] Detected VIPT I-cache on CPU3
[ 0.061144] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 0.061193] smp: Brought up 1 node, 4 CPUs
[ 0.095586] SMP: Total of 4 processors activated.
[ 0.100259] CPU features: detected: 32-bit EL0 Support
[ 0.106905] CPU: All CPU(s) started at EL2
[ 0.109439] alternatives: patching kernel code
[ 0.114561] devtmpfs: initialized
[ 0.121197] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.126825] futex hash table entries: 1024 (order: 4, 65536 bytes)
[ 0.138477] xor: measuring software checksum speed
[ 0.177027] 8regs : 2078.000 MB/sec
[ 0.217058] 8regs_prefetch: 1795.000 MB/sec
[ 0.257091] 32regs : 2384.000 MB/sec
[ 0.297123] 32regs_prefetch: 2020.000 MB/sec
[ 0.297164] xor: using function: 32regs (2384.000 MB/sec)
[ 0.301472] pinctrl core: initialized pinctrl subsystem
[ 0.307299] NET: Registered protocol family 16
[ 0.311397] audit: initializing netlink subsys (disabled)
[ 0.316504] audit: type=2000 audit(0.264:1): state=initialized audit_enabled=0 res=1
[ 0.324151] cpuidle: using governor menu
[ 0.328191] vdso: 2 pages (1 code @ (____ptrval____), 1 data @ (____ptrval____))
[ 0.335376] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.342834] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.362553] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[ 0.430923] raid6: int64x1 gen() 392 MB/s
[ 0.498861] raid6: int64x1 xor() 393 MB/s
[ 0.566921] raid6: int64x2 gen() 598 MB/s
[ 0.634983] raid6: int64x2 xor() 523 MB/s
[ 0.703046] raid6: int64x4 gen() 858 MB/s
[ 0.771039] raid6: int64x4 xor() 644 MB/s
[ 0.839100] raid6: int64x8 gen() 1019 MB/s
[ 0.907135] raid6: int64x8 xor() 664 MB/s
[ 0.975217] raid6: neonx1 gen() 644 MB/s
[ 1.043267] raid6: neonx1 xor() 769 MB/s
[ 1.111289] raid6: neonx2 gen() 989 MB/s
[ 1.179354] raid6: neonx2 xor() 1025 MB/s
[ 1.247388] raid6: neonx4 gen() 1295 MB/s
[ 1.315454] raid6: neonx4 xor() 1240 MB/s
[ 1.383499] raid6: neonx8 gen() 1348 MB/s
[ 1.451553] raid6: neonx8 xor() 1277 MB/s
[ 1.451591] raid6: using algorithm neonx8 gen() 1348 MB/s
[ 1.455552] raid6: .... xor() 1277 MB/s, rmw enabled
[ 1.460479] raid6: using neon recovery algorithm
[ 1.465875] SCSI subsystem initialized
[ 1.468814] libata version 3.00 loaded.
[ 1.468963] usbcore: registered new interface driver usbfs
[ 1.474268] usbcore: registered new interface driver hub
[ 1.479541] usbcore: registered new device driver usb
[ 1.484589] media: Linux media interface: v0.10
[ 1.489047] videodev: Linux video capture interface: v2.00
[ 1.494501] pps_core: LinuxPPS API ver. 1 registered
[ 1.499404] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 1.508497] PTP clock support registered
[ 1.512396] EDAC MC: Ver: 3.0.0
[ 1.515917] zynqmp-ipi-mbox mailbox@ff990400: Probed ZynqMP IPI Mailbox driver.
[ 1.523029] zynqmp-ipi-mbox mailbox@ff90000: Probed ZynqMP IPI Mailbox driver.
[ 1.530059] FPGA manager framework
[ 1.533470] Advanced Linux Sound Architecture Driver Initialized.
[ 1.539660] Bluetooth: Core ver 2.22
[ 1.542929] NET: Registered protocol family 31
[ 1.547326] Bluetooth: HCI device and connection manager initialized
[ 1.553642] Bluetooth: HCI socket layer initialized
[ 1.558484] Bluetooth: L2CAP socket layer initialized
[ 1.563517] Bluetooth: SCO socket layer initialized
[ 1.568707] clocksource: Switched to clocksource arch_sys_counter
[ 1.574481] VFS: Disk quotas dquot_6.6.0
[ 1.578343] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 1.589987] NET: Registered protocol family 2
[ 1.590411] tcp_listen_portaddr_hash hash table entries: 2048 (order: 3, 32768 bytes)
[ 1.597284] TCP established hash table entries: 32768 (order: 6, 262144 bytes)
[ 1.604643] TCP bind hash table entries: 32768 (order: 7, 524288 bytes)
[ 1.611414] TCP: Hash tables configured (established 32768 bind 32768)
[ 1.617539] UDP hash table entries: 2048 (order: 4, 65536 bytes)
[ 1.623524] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes)
[ 1.630010] NET: Registered protocol family 1
[ 1.634402] RPC: Registered named UNIX socket transport module.
[ 1.640060] RPC: Registered udp transport module.
[ 1.644725] RPC: Registered tcp transport module.
[ 1.649395] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 1.656059] PCI: CLS 0 bytes, default 64
[ 1.656154] Trying to unpack rootfs image as initramfs...
[ 4.525948] Freeing initrd memory: 53404K
[ 4.526514] hw perfevents: no interrupt-affinity property for /pmu, guessing.
[ 4.531597] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available
[ 4.540093] Initialise system trusted keyrings
[ 4.543985] workingset: timestamp_bits=62 max_order=20 bucket_order=0
[ 4.550691] NFS: Registering the id_resolver key type
[ 4.554969] Key type id_resolver registered
[ 4.559101] Key type id_legacy registered
[ 4.563085] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[ 4.569754] jffs2: version 2.2. (NAND) \xc2\xa9 2001-2006 Red Hat, Inc.
[ 5.815418] NET: Registered protocol family 38
[ 5.883524] Key type asymmetric registered
[ 5.883563] Asymmetric key parser 'x509' registered
[ 5.886882] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[ 5.894187] io scheduler noop registered
[ 5.898076] io scheduler deadline registered
[ 5.902342] io scheduler cfq registered (default)
[ 5.906987] io scheduler mq-deadline registered
[ 5.911484] io scheduler kyber registered
[ 5.946884] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[ 5.951210] cacheinfo: Unable to detect cache hierarchy for CPU 0
[ 5.958780] brd: module loaded
[ 5.963021] loop: module loaded
[ 5.963902] mtdoops: mtd device (mtddev=name/number) must be supplied
[ 5.968358] libphy: Fixed MDIO Bus: probed
[ 5.972398] tun: Universal TUN/TAP device driver, 1.6
[ 5.976137] CAN device driver interface
[ 5.980868] usbcore: registered new interface driver asix
[ 5.985229] usbcore: registered new interface driver ax88179_178a
[ 5.991264] usbcore: registered new interface driver cdc_ether
[ 5.997058] usbcore: registered new interface driver net1080
[ 6.002681] usbcore: registered new interface driver cdc_subset
[ 6.008565] usbcore: registered new interface driver zaurus
[ 6.014110] usbcore: registered new interface driver cdc_ncm
[ 6.020240] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 6.026185] ehci-pci: EHCI PCI platform driver
[ 6.030893] usbcore: registered new interface driver uas
[ 6.035908] usbcore: registered new interface driver usb-storage
[ 6.042397] rtc_zynqmp ffa60000.rtc: rtc core: registered ffa60000.rtc as rtc0
[ 6.049078] i2c /dev entries driver
[ 6.054208] usbcore: registered new interface driver uvcvideo
[ 6.058190] USB Video Class driver (1.1.1)
[ 6.062828] Bluetooth: HCI UART driver ver 2.3
[ 6.066672] Bluetooth: HCI UART protocol H4 registered
[ 6.071770] Bluetooth: HCI UART protocol BCSP registered
[ 6.077068] Bluetooth: HCI UART protocol LL registered
[ 6.082149] Bluetooth: HCI UART protocol ATH3K registered
[ 6.087531] Bluetooth: HCI UART protocol Three-wire (H5) registered
[ 6.093781] Bluetooth: HCI UART protocol Intel registered
[ 6.099125] Bluetooth: HCI UART protocol QCA registered
[ 6.104327] usbcore: registered new interface driver bcm203x
[ 6.109950] usbcore: registered new interface driver bpa10x
[ 6.115481] usbcore: registered new interface driver bfusb
[ 6.120934] usbcore: registered new interface driver btusb
[ 6.126351] Bluetooth: Generic Bluetooth SDIO driver ver 0.1
[ 6.132021] usbcore: registered new interface driver ath3k
[ 6.137564] EDAC MC: ECC not enabled
[ 6.141201] EDAC DEVICE0: Giving out device to module zynqmp-ocm-edac controller zynqmp_ocm: DEV ff960000.memory-controller (INTERRUPT)
[ 6.153815] sdhci: Secure Digital Host Controller Interface driver
[ 6.159221] sdhci: Copyright(c) Pierre Ossman
[ 6.163544] sdhci-pltfm: SDHCI platform and OF driver helper
[ 6.169514] ledtrig-cpu: registered to indicate activity on CPUs
[ 6.175189] zynqmp_firmware_probe Platform Management API v1.1
[ 6.180936] zynqmp_firmware_probe Trustzone version v1.0
[ 6.211371] zynqmp_clk_mux_get_parent() getparent failed for clock: lpd_wdt, ret = -22
[ 6.214090] alg: No test for xilinx-zynqmp-aes (zynqmp-aes)
[ 6.219281] zynqmp_aes zynqmp_aes: AES Successfully Registered

[ 6.226718] alg: No test for xilinx-keccak-384 (zynqmp-keccak-384)
[ 6.232866] alg: No test for xilinx-zynqmp-rsa (zynqmp-rsa)
[ 6.238430] usbcore: registered new interface driver usbhid
[ 6.243742] usbhid: USB HID core driver
[ 6.250016] fpga_manager fpga0: Xilinx ZynqMP FPGA Manager registered
[ 6.254347] usbcore: registered new interface driver snd-usb-audio
[ 6.261024] pktgen: Packet Generator for packet performance testing. Version: 2.75
[ 6.268032] Initializing XFRM netlink socket
[ 6.271945] NET: Registered protocol family 10
[ 6.276645] Segment Routing with IPv6
[ 6.279996] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[ 6.286141] NET: Registered protocol family 17
[ 6.290200] NET: Registered protocol family 15
[ 6.294614] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[ 6.307534] can: controller area network core (rev 20170425 abi 9)
[ 6.313661] NET: Registered protocol family 29
[ 6.318045] can: raw protocol (rev 20170425)
[ 6.322281] can: broadcast manager protocol (rev 20170425 t)
[ 6.327906] can: netlink gateway (rev 20170425) max_hops=1
[ 6.333416] Bluetooth: RFCOMM TTY layer initialized
[ 6.338205] Bluetooth: RFCOMM socket layer initialized
[ 6.343319] Bluetooth: RFCOMM ver 1.11
[ 6.347025] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 6.352296] Bluetooth: BNEP filters: protocol multicast
[ 6.357489] Bluetooth: BNEP socket layer initialized
[ 6.362417] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[ 6.368300] Bluetooth: HIDP socket layer initialized
[ 6.373346] 9pnet: Installing 9P2000 support
[ 6.377484] Key type dns_resolver registered
[ 6.382218] registered taskstats version 1
[ 6.385781] Loading compiled-in X.509 certificates
[ 6.390902] Btrfs loaded, crc32c=crc32c-generic
[ 6.401629] ff000000.serial: ttyPS0 at MMIO 0xff000000 (irq = 42, base_baud = 6249999) is a xuartps
[ 6.410741] console [ttyPS0] enabled
[ 6.414342] bootconsole [cdns0] disabled
[ 6.422505] of-fpga-region fpga-full: FPGA Region probed
[ 6.431803] xilinx-zynqmp-dma fd500000.dma: ZynqMP DMA driver Probe success
[ 6.438922] xilinx-zynqmp-dma fd510000.dma: ZynqMP DMA driver Probe success
[ 6.446049] xilinx-zynqmp-dma fd520000.dma: ZynqMP DMA driver Probe success
[ 6.453175] xilinx-zynqmp-dma fd530000.dma: ZynqMP DMA driver Probe success
[ 6.460300] xilinx-zynqmp-dma fd540000.dma: ZynqMP DMA driver Probe success
[ 6.467417] xilinx-zynqmp-dma fd550000.dma: ZynqMP DMA driver Probe success
[ 6.474539] xilinx-zynqmp-dma fd560000.dma: ZynqMP DMA driver Probe success
[ 6.481664] xilinx-zynqmp-dma fd570000.dma: ZynqMP DMA driver Probe success
[ 6.488877] xilinx-zynqmp-dma ffa80000.dma: ZynqMP DMA driver Probe success
[ 6.496001] xilinx-zynqmp-dma ffa90000.dma: ZynqMP DMA driver Probe success
[ 6.503121] xilinx-zynqmp-dma ffaa0000.dma: ZynqMP DMA driver Probe success
[ 6.510246] xilinx-zynqmp-dma ffab0000.dma: ZynqMP DMA driver Probe success
[ 6.517374] xilinx-zynqmp-dma ffac0000.dma: ZynqMP DMA driver Probe success
[ 6.524499] xilinx-zynqmp-dma ffad0000.dma: ZynqMP DMA driver Probe success
[ 6.531629] xilinx-zynqmp-dma ffae0000.dma: ZynqMP DMA driver Probe success
[ 6.538753] xilinx-zynqmp-dma ffaf0000.dma: ZynqMP DMA driver Probe success
[ 6.546044] ahci-ceva fd0c0000.ahci: AHCI 0001.0301 32 slots 2 ports 6 Gbps 0x3 impl platform mode
[ 6.555005] ahci-ceva fd0c0000.ahci: flags: 64bit ncq sntf pm clo only pmp fbs pio slum part ccc sds apst
[ 6.565890] scsi host0: ahci-ceva
[ 6.569478] scsi host1: ahci-ceva
[ 6.572955] ata1: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff] port 0x100 irq 39
[ 6.580869] ata2: SATA max UDMA/133 mmio [mem 0xfd0c0000-0xfd0c1fff] port 0x180 irq 39
[ 6.589286] zynqmp_pll_disable() clock disable failed for dpll_int, ret = -13
[ 6.599396] m25p80 spi0.0: n25q512a (131072 Kbytes)
[ 6.604287] 3 fixed-partitions partitions found on MTD device spi0.0
[ 6.610638] Creating 3 MTD partitions on "spi0.0":
[ 6.615422] 0x000000000000-0x000000100000 : "boot"
[ 6.620771] 0x000000100000-0x000000140000 : "bootenv"
[ 6.626287] 0x000000140000-0x000001740000 : "kernel"
[ 6.632712] macb ff0e0000.ethernet: Not enabling partial store and forward
[ 6.640122] libphy: MACB_mii_bus: probed
[ 6.716931] Marvell 88E1510 ff0e0000.ethernet-ffffffff:01: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=ff0e0000.ethernet-ffffffff:01, irq=POLL)
[ 6.730846] macb ff0e0000.ethernet eth0: Cadence GEM rev 0x50070106 at 0xff0e0000 irq 30 (00:0a:35:00:89:61)
[ 6.741060] xilinx-axipmon ffa00000.perf-monitor: Probed Xilinx APM
[ 6.747624] xilinx-axipmon fd0b0000.perf-monitor: Probed Xilinx APM
[ 6.754134] xilinx-axipmon fd490000.perf-monitor: Probed Xilinx APM
[ 6.760655] xilinx-axipmon ffa10000.perf-monitor: Probed Xilinx APM
[ 6.767200] dwc3-of-simple ff9d0000.usb0: dwc3_simple_set_phydata: Can't find usb3-phy
[ 6.775730] dwc3 fe200000.dwc3: Failed to get clk 'ref': -2
[ 6.781531] xilinx-psgtr fd400000.zynqmp_phy: xpsgtr_config_usbpipe: No valid Platform_data found
[ 6.790527] xilinx-psgtr fd400000.zynqmp_phy: Lane:1 type:0 protocol:3 pll_locked:yes
[ 6.799001] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[ 6.804493] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[ 6.812458] xhci-hcd xhci-hcd.0.auto: hcc params 0x0238f625 hci version 0x100 quirks 0x0000000202010810
[ 6.821870] xhci-hcd xhci-hcd.0.auto: irq 47, io mem 0xfe200000
[ 6.828020] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[ 6.836280] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 6.843497] usb usb1: Product: xHCI Host Controller
[ 6.848374] usb usb1: Manufacturer: Linux 4.19.0-xilinx-v2019.2 xhci-hcd
[ 6.855066] usb usb1: SerialNumber: xhci-hcd.0.auto
[ 6.860240] hub 1-0:1.0: USB hub found
[ 6.864015] hub 1-0:1.0: 1 port detected
[ 6.868139] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[ 6.873624] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[ 6.881279] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[ 6.888022] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19
[ 6.896284] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 6.901867] ata2: SATA link down (SStatus 0 SControl 330)
[ 6.903504] usb usb2: Product: xHCI Host Controller
[ 6.913751] usb usb2: Manufacturer: Linux 4.19.0-xilinx-v2019.2 xhci-hcd
[ 6.920443] usb usb2: SerialNumber: xhci-hcd.0.auto
[ 6.925600] hub 2-0:1.0: USB hub found
[ 6.929364] hub 2-0:1.0: 1 port detected
[ 6.934479] i2c i2c-0: Added multiplexed i2c bus 1
[ 6.939421] i2c i2c-0: Added multiplexed i2c bus 2
[ 6.944361] i2c i2c-0: Added multiplexed i2c bus 3
[ 6.949292] i2c i2c-0: Added multiplexed i2c bus 4
[ 6.954236] i2c i2c-0: Added multiplexed i2c bus 5
[ 6.959857] at24 6-0050: 1024 byte 24c08 EEPROM, writable, 1 bytes/write
[ 6.966589] i2c i2c-0: Added multiplexed i2c bus 6
[ 6.971533] i2c i2c-0: Added multiplexed i2c bus 7
[ 6.976471] i2c i2c-0: Added multiplexed i2c bus 8
[ 6.981259] pca954x 0-0073: registered 8 multiplexed busses for I2C switch pca9548
[ 6.989228] i2c i2c-0: Added multiplexed i2c bus 9
[ 6.994164] i2c i2c-0: Added multiplexed i2c bus 10
[ 6.999184] i2c i2c-0: Added multiplexed i2c bus 11
[ 7.004204] i2c i2c-0: Added multiplexed i2c bus 12
[ 7.009223] i2c i2c-0: Added multiplexed i2c bus 13
[ 7.014241] i2c i2c-0: Added multiplexed i2c bus 14
[ 7.019257] i2c i2c-0: Added multiplexed i2c bus 15
[ 7.024277] i2c i2c-0: Added multiplexed i2c bus 16
[ 7.029155] pca954x 0-0077: registered 8 multiplexed busses for I2C switch pca9548
[ 7.036749] cdns-i2c ff020000.i2c: 400 kHz mmio ff020000 irq 32
[ 7.043124] cdns-wdt fd4d0000.watchdog: Xilinx Watchdog Timer with timeout 60s
[ 7.050649] cdns-wdt ff150000.watchdog: Xilinx Watchdog Timer with timeout 10s
[ 7.058180] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 1049999 KHz
[ 7.065631] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 1199999 KHz
[ 7.076729] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 330)
[ 7.083265] ata1.00: supports DRM functions and may not be fully accessible
[ 7.090233] ata1.00: ATA-11: Samsung SSD 860 EVO 1TB, RVT04B6Q, max UDMA/133
[ 7.097277] ata1.00: 1953525168 sectors, multi 1: LBA48 NCQ (depth 32)
[ 7.104722] mmc0: SDHCI controller on ff160000.mmc [ff160000.mmc] using ADMA 64-bit
[ 7.105597] ata1.00: supports DRM functions and may not be fully accessible
[ 7.120762] ata1.00: configured for UDMA/133
[ 7.125306] scsi 0:0:0:0: Direct-Access ATA Samsung SSD 860 4B6Q PQ: 0 ANSI: 5
[ 7.133841] ata1.00: Enabling discard_zeroes_data
[ 7.138625] sd 0:0:0:0: [sda] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
[ 7.146291] sd 0:0:0:0: [sda] Write Protect is off
[ 7.148719] mmc1: SDHCI controller on ff170000.mmc [ff170000.mmc] using ADMA 64-bit
[ 7.151084] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
[ 7.158748] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 7.167791] rtc_zynqmp ffa60000.rtc: setting system clock to 1970-01-01 00:00:21 UTC (21)
[ 7.175970] of_cfs_init
[ 7.176077] ata1.00: Enabling discard_zeroes_data
[ 7.178434] of_cfs_init: OK
[ 7.185196] sda: sda1 sda2
[ 7.186011] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 7.189251] ata1.00: Enabling discard_zeroes_data
[ 7.201286] sd 0:0:0:0: [sda] Attached SCSI disk
[ 7.202423] mmc0: new HS200 MMC card at address 0001
[ 7.211438] mmcblk0: mmc0:0001 Q2J54A 3.59 GiB
[ 7.216361] mmcblk0boot0: mmc0:0001 Q2J54A partition 1 16.0 MiB
[ 7.222668] mmcblk0boot1: mmc0:0001 Q2J54A partition 2 16.0 MiB
[ 7.228648] usb 1-1: new full-speed USB device number 2 using xhci-hcd
[ 7.235217] mmcblk0rpmb: mmc0:0001 Q2J54A partition 3 512 KiB, chardev (244:0)
[ 7.273689] mmc1: new high speed SDHC card at address aaaa
[ 7.279681] mmcblk1: mmc1:aaaa SS16G 14.8 GiB
[ 7.289113] mmcblk1: p1 p2
[ 7.352267] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 7.358800] clk: Not disabling unused clocks
[ 7.363066] ALSA device list:
[ 7.366028] No soundcards found.
[ 7.369736] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 7.378348] cfg80211: failed to load regulatory.db
[ 7.383959] Freeing unused kernel memory: 832K
[ 7.400737] Run /init as init process
[ 7.508758] usb 1-1: new high-speed USB device number 3 using xhci-hcd
[ 7.545099] udevd[1839]: starting version 3.2.5
[ 7.549993] random: udevd: uninitialized urandom read (16 bytes read)
[ 7.556482] random: udevd: uninitialized urandom read (16 bytes read)
[ 7.562985] random: udevd: uninitialized urandom read (16 bytes read)
[ 7.574021] udevd[1840]: starting eudev-3.2.5
[ 7.661061] usb 1-1: New USB device found, idVendor=04b4, idProduct=650a, bcdDevice=50.00
[ 7.669263] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 7.688358] zynqmp_r5_remoteproc ff9a0000.zynqmp-rpu: RPU core_conf: split
[ 7.695412] r5@0: DMA mask not set
[ 7.698933] r5@0: assigned reserved memory node rproc@3ed400000
[ 7.705066] remoteproc remoteproc0: r5@0 is available
[ 7.720165] hub 1-1:1.0: USB hub found
[ 7.724155] hub 1-1:1.0: 4 ports detected
[ 7.780097] random: fast init done
[ 8.078963] EXT4-fs (sda2): recovery complete
[ 8.084684] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[ 8.267714] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
[ 8.275986] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 8.564918] urandom_read: 4 callbacks suppressed
[ 8.564922] random: dd: uninitialized urandom read (512 bytes read)
[ 8.707235] pps pps0: new PPS source ptp0
[ 8.711260] macb ff0e0000.ethernet: gem-ptp-timer ptp clock registered.
[ 8.717976] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 17.926476] random: dropbearkey: uninitialized urandom read (32 bytes read)
[ 17.936615] random: dropbearkey: uninitialized urandom read (32 bytes read)
[ 18.789595] random: crng init done
[ 60.363852] remoteproc remoteproc0: powering up r5@0
[ 60.369810] remoteproc remoteproc0: Booting fw image echoapplication, size 849344
[ 60.381030] r5@0: RPU boot from TCM.
[ 60.384222] remoteproc remoteproc0: registered virtio0 (type 7)
[ 60.401533] remoteproc remoteproc0: remote processor r5@0 is now up
[ 60.401932] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 60.412294] virtio_rpmsg_bus virtio0: creating channel rpmsg-openamp-demo-channel addr 0x0
[ 65.755681] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.765694] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.776773] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.788580] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.800476] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.812377] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.824279] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.836171] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.848072] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.860049] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.871933] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.880949] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.887295] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.893643] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.899994] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.906342] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.916181] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.926214] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.936246] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.946336] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.956359] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.966348] virtio_rpmsg_bus virtio0: msg received with no recipient
[ 65.976382] virtio_rpmsg_bus virtio0: msg received with no recipient

0 Kudos
2,374 Views
Registered: ‎01-10-2020

I guess I found the reason of this segmentation fault. It's because I am reaching the limit of the open files. I am opening too many file descriptors in my linux Application. 

I our use case I have to write the data received from RPU in csv files on a sata external drive. I tried to just open csv files in the sata drive for every set of 40 rpmsg Packets. But after 40960 Packets (40*1024) I reached the limit of the allowed number of file descriptors for a process on linux. I found some threads explaining how to increase the value of this limit but it wont solve my problem because in our project I will receive an unlimited number of data packets. So I need a workaround in order to avoid reaching  this open files limit or to reset the counter of the open files on zero before that it reaches its limit.

0 Kudos
simon.beaudoin
Adventurer
Adventurer
2,361 Views
Registered: ‎05-08-2018

Sorry, I havent really had the time to take an indepth look at your code. You seem to have found out the issue by yourself, which is great! 

Now, may I suggest closing the file descriptors when you're done receiving data for that file? I find it hard to believe you have a use in keeping opened such a huge amount of files...  

0 Kudos
2,355 Views
Registered: ‎01-10-2020

I tried to close every file before opening a new file. But I still get the same problem. I guess the number of the used file descriptors doesn't get decreased after the fclose(fd) instruction.

0 Kudos
simon.beaudoin
Adventurer
Adventurer
2,346 Views
Registered: ‎05-08-2018

Unlike process IDs, which are recycle only gradually, the kernel always allocates the lowest unused file descriptor when a new descriptor is created. This means that in a multi-threaded program which constantly opens and closes file descriptors, descriptors are reused very quickly.

Could you try commenting the code responsible for writing your data to cvs files and let the received data fall in the void? Isolate to the maximum things. Sometimes you have to return to the very basics in order to find bugs

0 Kudos
nunu
Contributor
Contributor
2,307 Views
Registered: ‎06-08-2017

Hi,
will this solution work also for a Zynq-7000 platfrom?
On this site:
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/118358017/OpenAMP+2019.1#OpenAMP2019.1-FeatureChanges

The patch is marked als experimental and the link to the patch is broken.

Best Regards



0 Kudos