summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2018-12-26 18:13:24 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2019-10-11 11:37:18 -0400
commit7b3d5d6bf07e9d7633995ca7c4c1ab4090a139e7 (patch)
tree97022e86785c52edbef59501833a2ed2f15c3fee
parent99700222a553bc40bd1d1c8a7d430ce2090ecc93 (diff)
gpu: nvgpu: fix NVGPU_COND_WAIT_INTERRUPTIBLE
When called with timeout=0, NVGPU_COND_WAIT_INTERRUPTIBLE macro ignores the return code from wait_event_interruptible. As a result we do not detect when the call is interrupted, and the calling process hangs. Use wait_event_interruptible return code in case of infinite timeout. Bug 200384829 Bug 200543218 Change-Id: I930f0d08c73a3b91ab20a6c8faaf633a3d7aee4d Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1982242 (cherry picked from commit 78c513790ac64605cea673c26e6d0d71c3d8db0a) Reviewed-on: https://git-master.nvidia.com/r/2215159 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Tested-by: Peter Daifuku <pdaifuku@nvidia.com> Reviewed-by: Satish Arora <satisha@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/linux/cond.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/cond.h b/drivers/gpu/nvgpu/include/nvgpu/linux/cond.h
index afe9c8c8..b53ada37 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/linux/cond.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/cond.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -73,7 +73,7 @@ struct nvgpu_cond {
73 else if (_ret == -ERESTARTSYS) \ 73 else if (_ret == -ERESTARTSYS) \
74 ret = -ERESTARTSYS; \ 74 ret = -ERESTARTSYS; \
75 } else { \ 75 } else { \
76 wait_event_interruptible((c)->wq, condition); \ 76 ret = wait_event_interruptible((c)->wq, condition); \
77 } \ 77 } \
78 ret; \ 78 ret; \
79}) 79})