Skip to content

Commit

Permalink
openamp: don't need check status when get_tx_payload
Browse files Browse the repository at this point in the history
The call of rproc_virtio_get_status will access the resource table,
but the resource table only belongs to the shm of one of the CPUs,
so after sleep, the other CPU cannot access it, so we don't need to
check the status for rpmsg_virtio_get_tx_payload_buffer every times.
Signed-off-by: Guiding Li <[email protected]>
Signed-off-by: Jiuzhu Dong <[email protected]>
  • Loading branch information
Donny9 committed Apr 18, 2022
1 parent 4cb9f1b commit feca5cb
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/rpmsg/rpmsg_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,10 @@ static void *rpmsg_virtio_get_tx_payload_buffer(struct rpmsg_device *rdev,
struct rpmsg_hdr *rp_hdr;
uint16_t idx;
int tick_count;
int status;

/* Get the associated remote device for channel. */
rvdev = metal_container_of(rdev, struct rpmsg_virtio_device, rdev);

/* Validate device state */
status = rpmsg_virtio_get_status(rvdev);
if (!(status & VIRTIO_CONFIG_STATUS_DRIVER_OK))
return NULL;

if (wait)
tick_count = RPMSG_TICK_COUNT / RPMSG_TICKS_PER_INTERVAL;
else
Expand Down

0 comments on commit feca5cb

Please sign in to comment.