Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1bec062 authored by Joerg Roedel's avatar Joerg Roedel
Browse files

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: default avatarJoerg Roedel <jroedel@suse.de>
parent 91f65fac
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -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);
}