[IMX8MP] rpmsg vqueue interrupt not firing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[IMX8MP] rpmsg vqueue interrupt not firing

Jump to solution
435 Views
Airbus_A320
Contributor II

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

Tags (2)
0 Kudos
Reply
1 Solution
364 Views
Airbus_A320
Contributor II

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

View solution in original post

0 Kudos
Reply
3 Replies
375 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

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.

Zhiming_Liu_0-1713765772455.png

 

You can use rpmsg-lite framework or refer it's code.

https://github.com/nxp-mcuxpresso/rpmsg-lite

0 Kudos
Reply
365 Views
Airbus_A320
Contributor II

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

0 Kudos
Reply
369 Views
Airbus_A320
Contributor II

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

Airbus_A320_0-1713771572281.png

This way it will not freeze, but this means there something that's not working in the waking mechanism

0 Kudos
Reply