]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Fix bug in put_pasid_state_wait
authorOded Gabbay <oded.gabbay@amd.com>
Thu, 16 Apr 2015 14:08:44 +0000 (17:08 +0300)
committerJoerg Roedel <jroedel@suse.de>
Mon, 4 May 2015 11:20:22 +0000 (13:20 +0200)
commit99819baf8ef8ba408a596385e3b9945e465c3128
treeb1a9f44753f394ec88f65c32687f46e6f699ec46
parent194b7115c289879d9d371e5ad3e7d18c3489ecbf
iommu/amd: Fix bug in put_pasid_state_wait

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.

Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Cc: stable@vger.kernel.org #v4.0
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu_v2.c