-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
openamp: change rx buffer hold flag to count
This commit fix one issue, before this commit, if rpmsg_hold_rx_buffer() is called in the endpoint callback to hold current received buffer and call rpmsg_release_rx_buffer() to release this buffer immediately. This buffer will be returned to the virtqueue in rpmsg_virtio_release_rx_buffer() and returned to virtqueue again in rpmsg_virtio_return_buffer() after the ept->cb() So same buffer returned to the virtqueue twice, error happened. Follow shows this process: rpmsg_virtio_rx_callback() - get rp_hdr - ept->cb(data = RPMSG_LOCATE_DATA(rp_hdr)) - rpsmg_hold_rx_buffer(data) - rpmsg_release_rx_buffer(data) here has returned buffer to virtqueue - rpmsg_virtio_return_buffer() return same buffer to virtqueue again So this commit change the HELD flag in rp_hdr to count to fix this issue and also support hold/release rx buffer recursively. Signed-off-by: Guiding Li <[email protected]> Signed-off-by: Yin Tao <[email protected]>
- Loading branch information
Showing
2 changed files
with
38 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters