From d5c0b30e00b23f84a76008965fc6f11e0a2d1430 Mon Sep 17 00:00:00 2001 From: Anmolpreet Kaur Date: Thu, 1 Dec 2022 04:04:03 +0530 Subject: [PATCH] smcinvoke: Wait for new requests in case of invalid cbtxn In case the accept thread has invalid cbtxn, start waiting for new requests instead of going to userspace and then coming back. Change-Id: I2cce16ebb0481d184fed636a559e73adaacdcf0f Signed-off-by: Anmolpreet Kaur --- smcinvoke/smcinvoke.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/smcinvoke/smcinvoke.c b/smcinvoke/smcinvoke.c index d29258e75f..0d83a29fcc 100644 --- a/smcinvoke/smcinvoke.c +++ b/smcinvoke/smcinvoke.c @@ -2197,14 +2197,13 @@ static long process_accept_req(struct file *filp, unsigned int cmd, * invoke thread died while server was processing cb req. * if invoke thread dies, it would remove req from Q. So * no matching cb_txn would be on Q and hence NULL cb_txn. - * In this case, we want this thread to come back and start - * waiting for new cb requests, hence return EAGAIN here + * In this case, we want this thread to start waiting + * new cb requests. */ if (!cb_txn) { pr_err("%s txn %d either invalid or removed from Q\n", __func__, user_args.txn_id); - ret = -EAGAIN; - goto out; + goto start_waiting_for_requests; } ret = marshal_out_tzcb_req(&user_args, cb_txn, cb_txn->filp_to_release); @@ -2228,6 +2227,7 @@ static long process_accept_req(struct file *filp, unsigned int cmd, if (ret && OBJECT_COUNTS_NUM_OO(user_args.counts)) goto out; } +start_waiting_for_requests: /* * Once response has been delivered, thread will wait for another * callback req to process.