diff options
author | Zhijun He <zhhe@nvidia.com> | 2010-10-11 20:55:20 -0700 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2010-10-13 14:56:37 -0700 |
commit | 13bf45b3c548319aa411541c760516ffe1b5eaff (patch) | |
tree | 53f68d92f522461c9af3d57125633516cb6a3215 /drivers | |
parent | 41aebc5456d4c6ae5f8d1543b478739331d500ec (diff) |
video: tegra: nvhost: fix race condition in hostintr wait list
Reviewed-on: http://git-master/r/6507
(cherry picked from commit 3708cd7a859d1ca4f3230bc8bfb018894bb6277e)
Change-Id: I1609b8b8d1f2de51f7eafa2105fb1f695903a252
Reviewed-on: http://git-master.nvidia.com/r/8262
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/tegra/host/nvhost_intr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/tegra/host/nvhost_intr.c b/drivers/video/tegra/host/nvhost_intr.c index 4a546babd5ab..7400a895ed5f 100644 --- a/drivers/video/tegra/host/nvhost_intr.c +++ b/drivers/video/tegra/host/nvhost_intr.c @@ -220,8 +220,9 @@ static void run_handlers(struct list_head completed[NVHOST_INTR_ACTION_COUNT]) list_for_each_entry_safe(waiter, next, head, list) { list_del(&waiter->list); handler(waiter); - atomic_set(&waiter->state, WLS_HANDLED); - smp_wmb(); + if (atomic_cmpxchg(&waiter->state, WLS_REMOVED, + WLS_HANDLED) != WLS_REMOVED) + BUG(); kref_put(&waiter->refcount, waiter_release); } } |