Skip to contentSkip to conversation

Patch "iommu/amd: Fix bug in put_pasid_state_wait" has been added to the 4.0-stable tree

PATCH [email protected] 1 participant 1 message Jun 2, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iommu/amd: Fix bug in put_pasid_state_wait

to the 4.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
iommu-amd-fix-bug-in-put_pasid_state_wait.patch
and it can be found in the queue-4.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 1bf1b431d98d7e5b5419876d4c219469e60693e1 Mon Sep 17 00:00:00 2001

From: Oded Gabbay <[email protected]>
Date: Thu, 16 Apr 2015 17:08:44 +0300
Subject: iommu/amd: Fix bug in put_pasid_state_wait

From: Oded Gabbay <[email protected]>

commit 1bf1b431d98d7e5b5419876d4c219469e60693e1 upstream.

This patch fixes a bug in put_pasid_state_wait that appeared in kernel 4.0 The bug is that pasid_state->count wasn't decremented before entering the wait_event. Thus, the condition in wait_event will never be true.

The fix is to decrement (atomically) the pasid_state->count before the wait_event.

---
 drivers/iommu/amd_iommu_v2.c |    1 +
 1 file changed, 1 insertion(+)
drivers/iommu/amd_iommu_v2.c +1 -0
@@ -266,6 +266,7 @@ static void put_pasid_state(struct pasid
 
 static void put_pasid_state_wait(struct pasid_state *pasid_state)
 {
+	atomic_dec(&pasid_state->count);
 	wait_event(pasid_state->wq, !atomic_read(&pasid_state->count));
 	free_pasid_state(pasid_state);
 }

Patches currently in stable-queue which might be from [email protected] are

queue-4.0/iommu-amd-fix-bug-in-put_pasid_state_wait.patch