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>
This commit is contained in:
Joerg Roedel 2015-02-04 15:50:38 +01:00
Родитель 91f65facba
Коммит a1bec062c9
1 изменённых файлов: 1 добавлений и 8 удалений

Просмотреть файл

@ -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) static void put_pasid_state_wait(struct pasid_state *pasid_state)
{ {
DEFINE_WAIT(wait); wait_event(pasid_state->wq, !atomic_read(&pasid_state->count));
prepare_to_wait(&pasid_state->wq, &wait, TASK_UNINTERRUPTIBLE);
if (!atomic_dec_and_test(&pasid_state->count))
schedule();
finish_wait(&pasid_state->wq, &wait);
free_pasid_state(pasid_state); free_pasid_state(pasid_state);
} }