[IMX8MP] rpmsg vqueue interrupt not firing

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[IMX8MP] rpmsg vqueue interrupt not firing

ソリューションへジャンプ
1,639件の閲覧回数
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

タグ(2)
0 件の賞賛
返信
1 解決策
1,568件の閲覧回数
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 件の賞賛
返信
3 返答(返信)
1,579件の閲覧回数
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 件の賞賛
返信
1,569件の閲覧回数
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 件の賞賛
返信
1,573件の閲覧回数
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 件の賞賛
返信