From 7d1a6876360d58c480da912307a5fd5c98474442 Mon Sep 17 00:00:00 2001 From: Advaya Andhare Date: Tue, 1 Aug 2023 12:05:01 +0000 Subject: [PATCH] nvvse: Allowing multiple access to dev node - This CL partially reverts the changes done in CL - 2891721 - Current implementation checks if multiple process/threads/apps try to access same dev node when it is already open by another process/thread/app, and throws an error if condition is true causing new process/threads/apps to fail as in bug mentioned below - This change allows multiple process/threads/apps to access the same dev node. bug 4126726 jira ESSS-759 Change-Id: Ibe18449014e69148ae2feebd854b6c5d278f5bc4 Signed-off-by: Advaya Andhare Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2946094 (cherry picked from commit 615a1aba49e2662d767a23e47fed329627f6f91e) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2956815 Reviewed-by: svcacv Reviewed-by: Nagaraj P N Reviewed-by: Manish Bhardwaj Reviewed-by: Vipin Kumar GVS: Gerrit_Virtual_Submit --- drivers/crypto/tegra-nvvse-cryptodev.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/crypto/tegra-nvvse-cryptodev.c b/drivers/crypto/tegra-nvvse-cryptodev.c index 7f8d725e..e5b9edc9 100644 --- a/drivers/crypto/tegra-nvvse-cryptodev.c +++ b/drivers/crypto/tegra-nvvse-cryptodev.c @@ -71,7 +71,6 @@ struct nvvse_devnode { struct miscdevice *g_misc_devices; - bool is_node_open; bool sha_init_done; } nvvse_devnode[MAX_NUMBER_MISC_DEVICES]; @@ -1815,11 +1814,6 @@ static int tnvvse_crypto_dev_open(struct inode *inode, struct file *filp) return -EINVAL; } - if (nvvse_devnode[node_id].is_node_open) { - pr_err("%s: Trying to open already opened node. node_id %u\n", __func__, node_id); - return -EAGAIN; - } - ctx = kzalloc(sizeof(struct tnvvse_crypto_ctx), GFP_KERNEL); if (!ctx) { return -ENOMEM; @@ -1843,7 +1837,6 @@ static int tnvvse_crypto_dev_open(struct inode *inode, struct file *filp) } filp->private_data = ctx; - nvvse_devnode[node_id].is_node_open = true; return ret; @@ -1863,7 +1856,6 @@ static int tnvvse_crypto_dev_release(struct inode *inode, struct file *filp) mutex_destroy(&ctx->lock); kfree(ctx->sha_result); kfree(ctx->rng_buff); - nvvse_devnode[ctx->node_id].is_node_open = false; kfree(ctx); filp->private_data = NULL;