rpmsg: glink: Do not send to remote proc in reset

If an intent is available and there is space in the fifo, glink sends
the message and returns success even when the remote proc is in reset.
This causes request/response type drivers to wait for a response from
a remote proc in reset which can delay cleanup. Return an error on send
if the remote proc is in reset.

Change-Id: Ic49aa5e545d871387b8ebd74ad2828ca2140645b
Signed-off-by: Chris Lew <clew@codeaurora.org>
This commit is contained in:
Chris Lew 2018-12-05 16:27:34 -08:00
parent c0f4d1deef
commit 37d78deabf

View file

@ -357,6 +357,9 @@ static int qcom_glink_tx(struct qcom_glink *glink,
if (tlen >= glink->tx_pipe->length)
return -EINVAL;
if (atomic_read(&glink->in_reset))
return -ECONNRESET;
spin_lock_irqsave(&glink->tx_lock, flags);
while (qcom_glink_tx_avail(glink) < tlen) {