diff options
author | vdumpa <vdumpa@nvidia.com> | 2010-10-18 15:06:53 -0700 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2010-11-11 16:53:03 -0800 |
commit | 88715e4daf073dab54e0b745cbe6af7e7180d2b2 (patch) | |
tree | 057e5f35cb7f422eea060f0e83f7ca4b032028f6 /arch/arm/mach-tegra/nvos | |
parent | 3afcb325ae817cf929d69a7a47560807c45fe241 (diff) |
[tegra/nvos] Handle -EINTR in NvOsSemaphoreWaitInterruptible
Handle the -EINTR case in NvOsSemaphoreWaitInterruptible API.
This would avoid forcing user process to handle the error correctly.
Bug 745410
Reviewed-on: http://git-master/r/8696
(cherry picked from commit 3ca38fe2c7851e7dc464cdd332c3eeb97a3089aa)
Change-Id: Id71c7d82cb7d613bc3726c32d15779defe783723
Reviewed-on: http://git-master/r/9723
Tested-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/nvos')
-rw-r--r-- | arch/arm/mach-tegra/nvos/nvos.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/nvos/nvos.c b/arch/arm/mach-tegra/nvos/nvos.c index 76662dc15459..7d6a1d7d192d 100644 --- a/arch/arm/mach-tegra/nvos/nvos.c +++ b/arch/arm/mach-tegra/nvos/nvos.c @@ -999,12 +999,20 @@ NvError NvOsSemaphoreUnmarshal( int NvOsSemaphoreWaitInterruptible(NvOsSemaphoreHandle semaphore); int NvOsSemaphoreWaitInterruptible(NvOsSemaphoreHandle semaphore) { + int ret; + NV_ASSERT(semaphore); if (sem_handle_search(semaphore) == NULL) return -EINVAL; - return down_interruptible(&semaphore->sem); + do { + ret = down_interruptible(&semaphore->sem); + if ( (ret != -EINTR) || ((ret == -EINTR) && (!try_to_freeze())) ) { + return ret; + } + schedule(); + } while (1); } void NvOsSemaphoreWait(NvOsSemaphoreHandle semaphore) |