From 00851c43f4d00e7451550660ab652e9ac9128e02 Mon Sep 17 00:00:00 2001
From: Emekcan <emekcan.aras@arm.com>
Date: Thu, 13 Oct 2022 20:53:42 +0100
Subject: [PATCH 6/6] Adds workaround for cs1k specific bug

Adds a temporary workaround to solve a possible
race-conditioning issue in the tee driver
for corstone1000.

Upstream-Status: Inappropriate
Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
---
 drivers/firmware/arm_ffa/driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
index d5e86ef40b89..cbb944f63321 100644
--- a/drivers/firmware/arm_ffa/driver.c
+++ b/drivers/firmware/arm_ffa/driver.c
@@ -32,6 +32,7 @@
 #include <linux/scatterlist.h>
 #include <linux/slab.h>
 #include <linux/uuid.h>
+#include <linux/delay.h>
 
 #include "common.h"
 
@@ -362,7 +363,7 @@ static int ffa_msg_send_direct_req(u16 src_id, u16 dst_id, bool mode_32bit,
 {
 	u32 req_id, resp_id, src_dst_ids = PACK_TARGET_INFO(src_id, dst_id);
 	ffa_value_t ret;
-
+	msleep(1);
 	if (mode_32bit) {
 		req_id = FFA_MSG_SEND_DIRECT_REQ;
 		resp_id = FFA_MSG_SEND_DIRECT_RESP;
-- 
2.39.0

