Skip to content

Commit

Permalink
iommu/amd: Use wait_event in put_pasid_state_wait
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel committed Feb 4, 2015
1 parent 91f65fa commit a1bec06
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions drivers/iommu/amd_iommu_v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,7 @@ static void put_pasid_state(struct pasid_state *pasid_state)

static void put_pasid_state_wait(struct pasid_state *pasid_state)
{
DEFINE_WAIT(wait);

prepare_to_wait(&pasid_state->wq, &wait, TASK_UNINTERRUPTIBLE);

if (!atomic_dec_and_test(&pasid_state->count))
schedule();

finish_wait(&pasid_state->wq, &wait);
wait_event(pasid_state->wq, !atomic_read(&pasid_state->count));
free_pasid_state(pasid_state);
}

Expand Down

0 comments on commit a1bec06

Please sign in to comment.