rpmsg: glink: Return error if receive callback is not present

There may be a rx packet on channel while receive callback is
not yet register. In that case rx packet will be missed and
not delivered to glink client.

Add check for receive callback. If it is not registered return
-EAGAIN, so that this packet can be retried on next interrupt.

Change-Id: Iff0873c8eef7ecfb4382bd2f73c3386ce9e5344a
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
This commit is contained in:
Deepak Kumar Singh 2020-05-27 12:27:22 +05:30
parent 00f1edbb81
commit ca6dac1f49

View file

@ -974,6 +974,14 @@ static int qcom_glink_rx_data(struct qcom_glink *glink, size_t avail)
/* Drop the message */
goto advance_rx;
}
if (!channel->ept.cb) {
dev_err(glink->dev,
"Callback not available on channel %s\n",
channel->name);
return -EAGAIN;
}
CH_INFO(channel, "chunk_size:%d left_size:%d\n", chunk_size, left_size);
if (glink->intentless) {