Skip to content

Commit fa51b16

Browse files
davejiangvinodkoul
authored andcommitted
dmaengine: idxd: fix calling wq quiesce inside spinlock
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 as it does not need device lock. Fixes: 5b0c68c ("dmaengine: idxd: support reporting of halt interrupt") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Dave Jiang <[email protected]> Link: https://lore.kernel.org/r/163716858508.1721911.15051495873516709923.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <[email protected]>
1 parent 1ffc6f3 commit fa51b16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/dma/idxd/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ static int process_misc_interrupts(struct idxd_device *idxd, u32 cause)
137137
INIT_WORK(&idxd->work, idxd_device_reinit);
138138
queue_work(idxd->wq, &idxd->work);
139139
} else {
140-
spin_lock(&idxd->dev_lock);
141140
idxd->state = IDXD_DEV_HALTED;
142141
idxd_wqs_quiesce(idxd);
143142
idxd_wqs_unmap_portal(idxd);
143+
spin_lock(&idxd->dev_lock);
144144
idxd_device_clear_state(idxd);
145145
dev_err(&idxd->pdev->dev,
146146
"idxd halted, need %s.\n",

0 commit comments

Comments
 (0)