Hi, I'm trying to figure out some strange behaviors I'm having with the communication between Linux and bare-metal M7 firmware.
I have a kernel module implementing an rpmsg endpoint and a chardevice. The userspace application makes ioctls calls and the module translates the requests into rpmsg messages.
On the M7 code, I have implemented the env-queue-* code using a simple ring buffer.
The system works, but if the user space sends messages too fast the buffer eventually fills, and the system freezes for 15 seconds. Looking into the rpmsg code in the kernel I found 15s is the timeout waiting for a free tx buffer. But, even with uart logging enabled, my M7 is performing all the queued operations in some milliseconds emptying the buffer.
It looks like, on the Linux side, the event waited with "wait_event_interruptible_timeout" is not raised during the 15s period... so the virtualqueue callback is not getting called.
I can't figure out how to fix this.
Thanks for the help
Solved! Go to Solution.
I found the issue. I was missing that RL_ALLOW_CONSUMED_BUFFERS_NOTIFICATION wasn't defined as equal to 1 in the default config file
Thanks for the support
Hi @Airbus_A320
Looks like your simple ring buffer framework clean the buffer, but you don't let kernel know this. You need notify kernel that you have already released this buffer.
You can use rpmsg-lite framework or refer it's code.
I found the issue. I was missing that RL_ALLOW_CONSUMED_BUFFERS_NOTIFICATION wasn't defined as equal to 1 in the default config file
Thanks for the support
I'm using the rpmsg-lite framework. I have implemented my ring buffer in env_create_queue, env_delete_queue, env_put_queue, env_get_queue, and env_get_current_queue_size functions in rpmsg_env_bm.c
In kernel code, in virtio_rpmsg_bus.c, I tried to remove the event waiting and insert a busy loop
This way it will not freeze, but this means there something that's not working in the waking mechanism