Skip to content

Commit

Permalink
rpmsg: qcom_smd: Read data of size equal to fifo size
Browse files Browse the repository at this point in the history
Add support to read data of size equal to the fifo size.

Change-Id: Iaa235df15f2b19d60b6e167532acbb5aa437e223
Signed-off-by: Prudhvi Yarlagadda <[email protected]>
  • Loading branch information
Prudhvi Yarlagadda authored and Gerrit - the friendly Code Review server committed Sep 2, 2020
1 parent df713f3 commit 9aa1469
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/rpmsg/qcom_smd.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ static size_t qcom_smd_channel_ext_read(struct qcom_smd_channel *channel)
ptr = channel->ext_buf;
}

if (channel->pkt_size > channel->fifo_size) {
if (channel->pkt_size >= channel->fifo_size) {
avail = qcom_smd_channel_get_rx_avail(channel);
len = qcom_smd_channel_peek(channel, ptr, avail);
} else {
Expand Down Expand Up @@ -630,8 +630,8 @@ static int qcom_smd_channel_recv_single(struct qcom_smd_channel *channel)

tail = GET_RX_CHANNEL_INFO(channel, tail);

/* use extended buffer if data size is greter than fifo size */
if ((channel->pkt_size > channel->fifo_size) ||
/* extended buffer if data size is greter than or equal to fifo size */
if ((channel->pkt_size >= channel->fifo_size) ||
channel->ext_pkt_size) {
len = qcom_smd_channel_ext_read(channel);
if (len == 0)
Expand Down Expand Up @@ -720,7 +720,7 @@ static bool qcom_smd_channel_intr(struct qcom_smd_channel *channel)
"%s: pkt_size: %d ch %s ed %s\n", __func__,
channel->pkt_size, channel->name, channel->edge->name);
} else if (channel->pkt_size && (avail >= channel->pkt_size ||
channel->pkt_size > channel->fifo_size)) {
channel->pkt_size >= channel->fifo_size)) {
ret = qcom_smd_channel_recv_single(channel);
if (ret) {
smd_ipc(channel->edge->ipc, false, NULL,
Expand Down

0 comments on commit 9aa1469

Please sign in to comment.