Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

risc-v/mpfs: ihc: don't wait for a remote ack #144

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Conversation

eenurkka
Copy link

@eenurkka eenurkka commented Aug 9, 2023

RPMSG is associated with the use of HPWORK / LPWORK queues. After sending a message to the remote end (Linux), it waits for an ack before proceeding.

Unfortunately this may take sometimes more than 0x3000 CLINT MTIME cycles. Ack waiting is also unnecessary: nothing is done with that information. Even worse, the net_lock() is also held during the blocked time so it blocks other network stacks that are unrelated to this.

The logic is still maintained (without the ack) with the message present (MP) flag. No new message will be sent until that is cleared by the remote.

Summary

It looks like the ihc breaks the network stack by blocking within the HPWORK/LPWORK with net_lock() taken. What happens eventually:

  1. Linux RPMSG tx queue gets full, no more messages may be sent
  2. NuttX network stack goes out of sync and sends data in inappropriate order
  3. RPMSG dies

Impact

All RPMSG client / servers

Testing

So far more than 6 hours with no problems (earlier: happening 100% < 3 hrs)

RPMSG is associated with the use of HPWORK / LPWORK queues.
After sending a message to the remote end (Linux), it waits
for an ack before proceeding.

Unfortunately this may take sometimes more than 0x3000 CLINT
MTIME cycles. Ack waiting is also unnecessary: nothing is done
with that information. Even worse, the net_lock() is also held
during the blocked time so it blocks other network stacks that
are unrelated to this.

The logic is still maintained with the message present (MP) flag.
No new message will be sent until that is cleared by the romote.

Signed-off-by: Eero Nurkkala <[email protected]>
@eenurkka eenurkka merged commit 977e0d8 into master Aug 10, 2023
8 checks passed
@eenurkka eenurkka deleted the rpmsg-wq-blocking branch November 13, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants