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

rpmsg: wait endpoint ready in rpmsg_send #238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xiaoxiang781216
Copy link
Collaborator

@xiaoxiang781216 xiaoxiang781216 commented Oct 31, 2020

because the remote need time to return the destination address

data, len, true);
metal_sleep_usec(RPMSG_TICKS_PER_INTERVAL);
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As previously discussed this imposes a way of implementing to other platforms which would not want to wait on first message, and not be blocked because channel has been closed by remote side (RPMSG_NS_DESTROY).

Look to me that test in rpmsg_send_offchannel_raw is enough to protect from a non initialized destination address .
The loop should be implement in application if necessary, to keep flexibility in the lib usage.

@edmooring
Any opinion on this?

Copy link
Collaborator Author

@xiaoxiang781216 xiaoxiang781216 Nov 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this change doesn't forbid the user do the loop in application, user has all possible choice:

  1. Call rpmsg_try_send and check the return value
  2. Check dest_addr before call rpmsg_send
  3. Let rpmsg_send to do the check

With this patch, user can still do item 1 and item 2 as they want, but item 3 can protect user if they forget to do the check.
BTW, it also follow the same behaviour when the vring buffer exhaust:
https://github.com/OpenAMP/open-amp/blob/master/lib/rpmsg/rpmsg_virtio.c#L305

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Arnaud. This changes the behavior of an existing API in a way that could be very surprising to a user by introducing a possible 15 second delay in their application.
This should be done in an application, where the user knows what conditions they might be expected and can set timeout values and retry patterns in a way that is best for them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's see how many user will report this issue and then decide whether a common solution is needed.

data, len, true);
metal_sleep_usec(RPMSG_TICKS_PER_INTERVAL);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Arnaud. This changes the behavior of an existing API in a way that could be very surprising to a user by introducing a possible 15 second delay in their application.
This should be done in an application, where the user knows what conditions they might be expected and can set timeout values and retry patterns in a way that is best for them.

@github-actions
Copy link

This pull request has been marked as a stale pull request because it has been open (more than) 45 days with no activity.

@github-actions github-actions bot added the Stale label Oct 24, 2023
because the remote need time to return the destination address

Signed-off-by: Guiding Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants