summaryrefslogtreecommitdiff
path: root/drivers/dma/idxd/device.c
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2021-09-29 12:15:38 -0700
committerVinod Koul <vkoul@kernel.org>2021-10-01 17:28:48 +0530
commit85f604af9c83a4656b1d07bec73298c3ba7d7c1e (patch)
tree3294dfb0c3776ffd509de7dcb3b9eb4e8143f159 /drivers/dma/idxd/device.c
parentae8f13f0a6fdd7562e420b756daa9b807e05f775 (diff)
downloadlinux-85f604af9c83a4656b1d07bec73298c3ba7d7c1e.tar.gz
linux-85f604af9c83a4656b1d07bec73298c3ba7d7c1e.tar.bz2
linux-85f604af9c83a4656b1d07bec73298c3ba7d7c1e.zip
dmaengine: idxd: move out percpu_ref_exit() to ensure it's outside submission
percpu_ref_tryget_live() is safe to call as long as ref is between init and exit according to the function comment. Move percpu_ref_exit() so it is called after the dma channel is no longer valid to ensure this holds true. Fixes: 93a40a6d7428 ("dmaengine: idxd: add percpu_ref to descriptor submission path") Suggested-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/163294293832.914350.10326422026738506152.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idxd/device.c')
-rw-r--r--drivers/dma/idxd/device.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
index 83a5ff2ecf2a..cbbfa17d8d11 100644
--- a/drivers/dma/idxd/device.c
+++ b/drivers/dma/idxd/device.c
@@ -427,7 +427,6 @@ void idxd_wq_quiesce(struct idxd_wq *wq)
{
percpu_ref_kill(&wq->wq_active);
wait_for_completion(&wq->wq_dead);
- percpu_ref_exit(&wq->wq_active);
}
/* Device control bits */