diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-02-04 09:50:38 -0500 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-02-04 09:50:51 -0500 |
commit | a1bec062c90456983225054d39c8a601db48e638 (patch) | |
tree | 2f5cbaa6b73e1b48fce4283b0c4870b2a8426f91 /drivers/iommu | |
parent | 91f65facba5add493fffb643acdb258bd9f54eb2 (diff) |
iommu/amd: Use wait_event in put_pasid_state_wait
Now that I learned about possible spurious wakeups this
place needs fixing too. Replace the self-coded sleep variant
with the generic wait_event() helper.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu_v2.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c index b6398d7285f7..5cc140969b43 100644 --- a/drivers/iommu/amd_iommu_v2.c +++ b/drivers/iommu/amd_iommu_v2.c | |||
@@ -266,14 +266,7 @@ static void put_pasid_state(struct pasid_state *pasid_state) | |||
266 | 266 | ||
267 | static void put_pasid_state_wait(struct pasid_state *pasid_state) | 267 | static void put_pasid_state_wait(struct pasid_state *pasid_state) |
268 | { | 268 | { |
269 | DEFINE_WAIT(wait); | 269 | wait_event(pasid_state->wq, !atomic_read(&pasid_state->count)); |
270 | |||
271 | prepare_to_wait(&pasid_state->wq, &wait, TASK_UNINTERRUPTIBLE); | ||
272 | |||
273 | if (!atomic_dec_and_test(&pasid_state->count)) | ||
274 | schedule(); | ||
275 | |||
276 | finish_wait(&pasid_state->wq, &wait); | ||
277 | free_pasid_state(pasid_state); | 270 | free_pasid_state(pasid_state); |
278 | } | 271 | } |
279 | 272 | ||