From b982595c5187d583e394bc52eaab515e439a12b8 Mon Sep 17 00:00:00 2001 From: Mahesh Kumar Date: Tue, 28 Sep 2021 06:04:54 +0000 Subject: [PATCH] platform: tegra: dce: retry interrupted rpc wait currently dce_client_ipc_wait_rpc function waits with "wait_event_interruptible". And if process is interrupted, it leads to RPC failure as "dce_ipc_send_message_sync" will try to read RPC msg when there is no msg to read yet. This CL make change to restart/retry wait if condition variable is not signaled by "dce_client_ipc_wakeup" Bug 200771402 Change-Id: I8f1c7781bab8b6c20b05251cc2862ad2db22cc1f Signed-off-by: Mahesh Kumar Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2600849 Reviewed-by: svcacv Reviewed-by: Santosh Galma Reviewed-by: Arun Swain Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/platform/tegra/dce/dce-client-ipc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/platform/tegra/dce/dce-client-ipc.c b/drivers/platform/tegra/dce/dce-client-ipc.c index a2fe8de4..9a55385b 100644 --- a/drivers/platform/tegra/dce/dce-client-ipc.c +++ b/drivers/platform/tegra/dce/dce-client-ipc.c @@ -275,9 +275,13 @@ static int dce_client_ipc_wait_rpc(struct tegra_dce *d, u32 int_type) return -EINVAL; } +retry_wait: DCE_COND_WAIT_INTERRUPTIBLE(&cl->recv_wait, atomic_read(&cl->complete) == 1, 0); + if (atomic_read(&cl->complete) != 1) + goto retry_wait; + atomic_set(&cl->complete, 0); return 0;