diff options
Diffstat (limited to 'drivers/iommu/amd_iommu_v2.c')
-rw-r--r-- | drivers/iommu/amd_iommu_v2.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c index 90d734bbf467..a2d87a60c27f 100644 --- a/drivers/iommu/amd_iommu_v2.c +++ b/drivers/iommu/amd_iommu_v2.c | |||
@@ -279,10 +279,8 @@ static void free_pasid_state(struct pasid_state *pasid_state) | |||
279 | 279 | ||
280 | static void put_pasid_state(struct pasid_state *pasid_state) | 280 | static void put_pasid_state(struct pasid_state *pasid_state) |
281 | { | 281 | { |
282 | if (atomic_dec_and_test(&pasid_state->count)) { | 282 | if (atomic_dec_and_test(&pasid_state->count)) |
283 | put_device_state(pasid_state->device_state); | ||
284 | wake_up(&pasid_state->wq); | 283 | wake_up(&pasid_state->wq); |
285 | } | ||
286 | } | 284 | } |
287 | 285 | ||
288 | static void put_pasid_state_wait(struct pasid_state *pasid_state) | 286 | static void put_pasid_state_wait(struct pasid_state *pasid_state) |
@@ -291,9 +289,7 @@ static void put_pasid_state_wait(struct pasid_state *pasid_state) | |||
291 | 289 | ||
292 | prepare_to_wait(&pasid_state->wq, &wait, TASK_UNINTERRUPTIBLE); | 290 | prepare_to_wait(&pasid_state->wq, &wait, TASK_UNINTERRUPTIBLE); |
293 | 291 | ||
294 | if (atomic_dec_and_test(&pasid_state->count)) | 292 | if (!atomic_dec_and_test(&pasid_state->count)) |
295 | put_device_state(pasid_state->device_state); | ||
296 | else | ||
297 | schedule(); | 293 | schedule(); |
298 | 294 | ||
299 | finish_wait(&pasid_state->wq, &wait); | 295 | finish_wait(&pasid_state->wq, &wait); |