Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62cc358f authored by Konstantin Dorfman's avatar Konstantin Dorfman
Browse files

soc: spcom: fix sleep only on pending send command



This change fixes unconditional sleep after sending data to RPMSG
peer, need to sleep only after not successful rpmsg_trysend.

Change-Id: Iaa8adb43f397863b50200c4b38d9d05b4b99e89f
Signed-off-by: default avatarKonstantin Dorfman <kdorfman@codeaurora.org>
parent 24af5c26
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -643,6 +643,8 @@ static int spcom_handle_send_command(struct spcom_channel *ch,
		}
		/* may fail when RX intent not queued by SP */
		ret = rpmsg_trysend(ch->rpdev->ept, tx_buf, tx_buf_size);
		if (ret == 0)
			break;
		time_msec += TX_RETRY_DELAY_MSEC;
		mutex_unlock(&ch->lock);
		msleep(TX_RETRY_DELAY_MSEC);
@@ -845,6 +847,8 @@ static int spcom_handle_send_modified_command(struct spcom_channel *ch,
		}
		/* may fail when RX intent not queued by SP */
		ret = rpmsg_trysend(ch->rpdev->ept, tx_buf, tx_buf_size);
		if (ret == 0)
			break;
		time_msec += TX_RETRY_DELAY_MSEC;
		mutex_unlock(&ch->lock);
		msleep(TX_RETRY_DELAY_MSEC);