[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190913152532.24484-5-jorge.ramirez-ortiz@linaro.org>
Date: Fri, 13 Sep 2019 17:25:31 +0200
From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@...aro.org>
To: jorge.ramirez-ortiz@...aro.org, gregkh@...uxfoundation.org,
arnd@...db.de, srinivas.kandagatla@...aro.org
Cc: linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org
Subject: [PATCH 4/5] misc: fastrpc: handle interrupted contexts
Buffers owned by a context that has been interrupted either by a
signal or a timeout might still be being accessed by the DSP.
delegate returning the associated memory to a later time when the
device is released.
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@...aro.org>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
drivers/misc/fastrpc.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index d2b639dfc461..40b48db032b5 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -952,12 +952,13 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel,
}
bail:
- /* We are done with this compute context, remove it from pending list */
- spin_lock(&fl->lock);
- list_del(&ctx->node);
- spin_unlock(&fl->lock);
- fastrpc_context_put(ctx);
-
+ if (err != -ERESTARTSYS && err != -ETIMEDOUT) {
+ /* We are done with this compute context */
+ spin_lock(&fl->lock);
+ list_del(&ctx->node);
+ spin_unlock(&fl->lock);
+ fastrpc_context_put(ctx);
+ }
if (err)
dev_dbg(fl->sctx->dev, "Error: Invoke Failed %d\n", err);
--
2.23.0
Powered by blists - more mailing lists