diff options
author | Varun Wadekar <vwadekar@nvidia.com> | 2013-06-11 15:33:20 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 13:34:22 -0700 |
commit | 86eda3416aca4f4863704bb0f6db08a5f6faf09c (patch) | |
tree | 62f64daa1a981d7b41a11656fb34b09b0919bee1 /security | |
parent | d2de8e9ee4cc7b9085da47eccd5788cc33a46129 (diff) |
security: nv_tee_driver: make wait_for_completion calls freezable
Bug 1305672
Change-Id: I21efcac292bfc2001087614437a4fee68fe5db69
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/237571
(cherry picked from commit 3d8d572a2aabe7d6943cd39ce42d82394c87ff5a)
Reviewed-on: http://git-master/r/249868
Reviewed-by: Automatic_Commit_Validation_User
Tested-by: Aaron Gamble <jgamble@nvidia.com>
Reviewed-by: James Zhao <jamesz@nvidia.com>
Tested-by: James Zhao <jamesz@nvidia.com>
Diffstat (limited to 'security')
-rw-r--r-- | security/nv_tee_driver/tee_fs.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/security/nv_tee_driver/tee_fs.c b/security/nv_tee_driver/tee_fs.c index 192bc2d3c3c2..a52ea255a8f5 100644 --- a/security/nv_tee_driver/tee_fs.c +++ b/security/nv_tee_driver/tee_fs.c @@ -21,6 +21,7 @@ #include <linux/list.h> #include <linux/completion.h> #include <linux/workqueue.h> +#include <linux/freezer.h> #include <asm/uaccess.h> @@ -65,8 +66,11 @@ int tee_handle_fs_ioctl(struct file *file, unsigned int ioctl_num, ptr_user_req = (TEEC_FileReq *)ioctl_param; + set_freezable(); + /* wait for a new request */ - wait_for_completion(&req_ready); + while (wait_for_completion_interruptible(&req_ready)) + try_to_freeze(); /* dequeue new request from the secure world */ req_node = list_first_entry(&req_list, struct tee_file_req_node, @@ -171,8 +175,11 @@ static void _tee_fs_file_operation(const char *name, void *buf, int len, list_add_tail(&req_list, &req_node->node); complete(&req_ready); + set_freezable(); + /* wait for the consumer's signal */ - wait_for_completion(&req_complete); + while (wait_for_completion_interruptible(&req_complete)) + try_to_freeze(); kfree(new_req); |