All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] dmaengine: idxd: fix calling wq quiesce inside spinlock
@ 2021-09-16 17:37 Dave Jiang
  0 siblings, 0 replies; only message in thread
From: Dave Jiang @ 2021-09-16 17:37 UTC (permalink / raw)
  To: vkoul; +Cc: Dan Carpenter, dmaengine

Dan reports that smatch has found idxd_wq_quiesce() is being called inside
the idxd->dev_lock. idxd_wq_quiesce() calls wait_for_completion() and
therefore it can sleep. Move the call outside of the spinlock.

Fixes: 5b0c68c473a1 ("dmaengine: idxd: support reporting of halt interrupt")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---

v2:
Rebase against 5.15-rc dmaengine/fixes

 drivers/dma/idxd/irq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/idxd/irq.c b/drivers/dma/idxd/irq.c
index ca88fa7a328e..1fe24b1b24be 100644
--- a/drivers/dma/idxd/irq.c
+++ b/drivers/dma/idxd/irq.c
@@ -133,8 +133,8 @@ static int process_misc_interrupts(struct idxd_device *idxd, u32 cause)
 			INIT_WORK(&idxd->work, idxd_device_reinit);
 			queue_work(idxd->wq, &idxd->work);
 		} else {
-			spin_lock(&idxd->dev_lock);
 			idxd_wqs_quiesce(idxd);
+			spin_lock(&idxd->dev_lock);
 			idxd_wqs_unmap_portal(idxd);
 			idxd_device_clear_state(idxd);
 			dev_err(&idxd->pdev->dev,



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-16 17:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 17:37 [PATCH v2] dmaengine: idxd: fix calling wq quiesce inside spinlock Dave Jiang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.