From 18e9ef2dda2487bf60d0827983bbc8e4009d3fed Mon Sep 17 00:00:00 2001 From: Subbaraman Narayanamurthy Date: Fri, 25 Sep 2020 18:04:44 -0700 Subject: [PATCH] soc: qcom: pmic_glink: Switch using rpmsg_send() to avoid random Tx failure When the remote subsystem is bought out of reset and PMIC Glink channel is opened up, PMIC Glink rpmsg driver is probed after which it instantiates all its child(client) devices. During its probe, these client devices start communicating to the remote subsystem over PMIC Glink channel. However, there is a race condition observed randomly where a transaction from a client is failing because rpmsg_trysend() couldn't send the message to the remote endpoint as the remote subsystem haven't queued up all Rx intents. To make the communication robust for clients, switch to use rpmsg_send() instead of rpmsg_trysend() which will wait until the Rx intents are queued up. Change-Id: Ia632efb420fa76face0aae6e039c3dcbf3e9517a Signed-off-by: Subbaraman Narayanamurthy --- drivers/soc/qcom/pmic_glink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/qcom/pmic_glink.c b/drivers/soc/qcom/pmic_glink.c index d4ada46b7759..62c28a4132ea 100644 --- a/drivers/soc/qcom/pmic_glink.c +++ b/drivers/soc/qcom/pmic_glink.c @@ -311,7 +311,7 @@ int pmic_glink_write(struct pmic_glink_client *client, void *data, } mutex_lock(&client->lock); - rc = rpmsg_trysend(client->pgdev->rpdev->ept, data, len); + rc = rpmsg_send(client->pgdev->rpdev->ept, data, len); mutex_unlock(&client->lock); if (rc < 0)